If you have
<input type="text" name="one">
<input type="button" name="two">
<input type="text" name="three">
you can see names of text fields
irb(main):016:0> ie.text_fields.each {|text_field| puts text_field.name}
one
three
=> 0
you can put names in array
irb(main):017:0> text_fields_names = []
=> []
irb(main):018:0> ie.text_fields.each {|text_field| text_fields_names <<
text_field.name}
=> 0
irb(main):019:0> text_fields_names
=> ["one", "three"]
you can see if that array is the same as you expected
irb(main):020:0> expected_text_fields_names = ["one", "three"]
=> ["one", "three"]
irb(main):021:0> expected_text_fields_names - text_fields_names
=> []
If you get empty array, then they are the same (not exactly, but works for
this, for more information see
http://www.ruby-doc.org/core/classes/Array.html#M002234).
--
ZeljkoFilipin.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general