As of Watir 1.5, one can select non-input elements by multiple attributes, e.g.
$ie.link(:text => 'Employees', :index => 2).click
See feature WTR-74 for details.
This has yet to be implemented for input elements (e.g. text_field).
Description
As of Watir 1.5, one can select non-input elements by multiple attributes, e.g.
$ie.link(:text => 'Employees', :index => 2).click
See feature WTR-74 for details.
This has yet to be implemented for input elements (e.g. text_field).
This is a bit annoying. On many pages array inputs are used, and one cannot perform unittests with WATIR, e.g.:
<input type="checkbox" name="checkboxlist"> something
<input type="checkbox" name="checkboxlist"> some other thing
<input type="checkbox" name="checkboxlist"> some entirely different thing
irb> ie.checkbox(:name, "checkboxlist").set
only checks the first box
irb> ie.checkbox(:name, "checkboxlist", :index => 2 ).set
generates an error (unable to locate)
Michael Schøler - 06/Jun/08 06:04 AM This is a bit annoying. On many pages array inputs are used, and one cannot perform unittests with WATIR, e.g.:
<input type="checkbox" name="checkboxlist"> something
<input type="checkbox" name="checkboxlist"> some other thing
<input type="checkbox" name="checkboxlist"> some entirely different thing
irb> ie.checkbox(:name, "checkboxlist").set
only checks the first box
irb> ie.checkbox(:name, "checkboxlist", :index => 2 ).set
generates an error (unable to locate)
<input type="checkbox" name="checkboxlist"> something
<input type="checkbox" name="checkboxlist"> some other thing
<input type="checkbox" name="checkboxlist"> some entirely different thing
irb> ie.checkbox(:name, "checkboxlist").set
only checks the first box
irb> ie.checkbox(:name, "checkboxlist", :index => 2 ).set
generates an error (unable to locate)