3
votes

I have two dropdowns, the second dropdown does not show until a choice is made from the first one. Using watir, i can select the first dropdown, and when i watch it, the second one becomes active, but it cannot select it. i just tried the regular select_list using name and id. Here is the code for the second drop down.

<td>
<input type="hidden" value="1" name="list" id="list">
<script type="text/JavaScript" language="JavaScript"></script>
<select>
<option value="">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</td>

I've also notice the value for the hidden field change as i select different options. Thanks for any help

3
Please post your Watir code and error messages, if any. How did you access select list with id, when it does not have one?Željko Filipin
Your question is incomplete.So please,provide your main ruby as well as html and errorunknownbits

3 Answers

1
votes

The way that I usually access drop down lists is by using this string:

@browser.select_list(:name, "list").set("3")

Does this help?

1
votes

I usually select hidden dropdowns this way

ie.hidden(:name=>"list").value='2'
0
votes

Try this:

browserObj = Watir::Browser.new
browserObj.goto('you html in browser')
//browserObj.hidden(:id,"list").value
browserObj.select_list(:name, "list").select_value('2')