7
votes

This is my drop down and i want to select it on its value option

<select id ="">
<option value="01" title="  01 - Live animals">  01 - Live animals</option>
</select>

I know that how to select drop down on its content i.e.

ie.select_list(:id, "DropDownList_Product").select("01 - Live animals")

actually I want to select drop down on its value 01,what should i have to do for that ?

1

1 Answers

15
votes

Something like this should work:

ie.select_list(:id, "DropDownList_Product").select_value("01")

More information at http://rdoc.info/gems/watir-webdriver/Watir/Select#select_value-instance_method