ie.text_field(:id,"mytextfield").value will get the value in the text field. You can't get the text_field attribute value by it.
Wesley. For life, the easier, the better. On Thu, Apr 8, 2010 at 9:27 AM, Rats <[email protected]> wrote: > I'm trying to check if a field is populated on a page. This command > works fine and returns "found it": > > if ie.text_field(:value,'some value').exists? > puts 'found it" > else > puts "did not find it" > end > > However this one doesn't: > > if ie.text_field(:id,"mytextfield").value == 'some value' > puts 'found it" > else > puts "did not find it" > end > > If I understand correctly the first example is looking for ALL text > fields on the page to see if any of them have "some value". The second > is more specific and is looking at a particular text field. > > I know for certain that "mytxtfield" contains the text I am looking > for ... > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: [email protected] > > To unsubscribe, reply using "remove me" as the subject. > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: [email protected]
