Select_list not working with Watir

212 views Asked by At

I am using safariwatir and I can't seem to get my code to work on selecting an option from a list. the syntax i used to select is:

browser.select_list(:id," select").select_value("USA")

Here is the HTML code for the table itself:

<table>
    <input type="textbox" name="selectedIndex" style="display:none" id="selectedIndex" />
    <input type="hidden" id="fromNo" />
    <input type="hidden" id="toNo" />
  <tr><td height="5px" colspan="2"></td></tr>
  <tr>
    <td class="col-header"> 
        Select Base No.
    </td>
    <td class="col-field" align="left"> 

       <select id="select" name="select" onChange="loadFrames();disableTemporarily('select');"> 

        <option value="" selected>Select a base</option>

        <option value="CSindicator=Y&MMindicator=Y&FXindicator=Y&customerNum=MTAzNjQ5&branch=MTAy&GFCID=&accountNum=&asOfDate=&countrycode=102&activebase=MTAzNjQ5&MERMAID=c2dsaW13ZWlzYW5vbmxpbg==&PLANERILLA=c2dsaW13ZWlzYW5vbmxpbg==">USA</option>



        </select>
    </td>
  </tr>
</table>

I have even tried to place the long value and all. When i run it, the terminal does output a nil, which in usual cases means its working but the list remains unselected.. Any ideas or help will be appreciated. Thanks.

1

There are 1 answers

0
Chuck van der Linden On

Sorry for the late response, but Safariwatir is pretty much a dead project at this point

Switch from Safariwatir to Watir-Webdriver see this link for details on how to make it work with Safari