Vatir question about choosing a hidden drop down list

I have two drop-down lists, the second drop-down menu is not displayed until a choice is made from the first. Using watir, I can select the first drop-down list, and when I look at it, the second becomes active, but it cannot select it. I just tried the usual select_list using name and id. Here is the code for the second fall.

<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 also noticed the value for hidden field change as I select different options. Thanks for any help

+3
source share
3 answers

Typically, I access drop-down lists using this line:

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

Does it help?

+1
source

ie.hidden(:name=>"list").value='2'
+1

:

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

Source: https://habr.com/ru/post/1748407/


All Articles