简体   繁体   中英

how to select dropdown on value option in ruby watir?

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 ie

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 ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM