samedi 3 mars 2018

How to select value in dropdown menu in ruby watir without knowing the value?

I'm trying to select something from a dropdown menu, without knowing what are the options. The code needs to work for many users and everyone has different values.

<select name="aspx_accountinformation_accountstatementsearch_ascxTRANSACTION_HISTORY1dfe5e76-b83a-4957-84c3-16e8ae795e9c$ddlAccount" id="aspx_accountinformation_accountstatementsearch_ascxTRANSACTION_HISTORY1dfe5e76-b83a-4957-84c3-16e8ae795e9c_ddlAccount" class="selectM">
                        <option value="Selectare">Selectare</option>
                        <option value="226523531-Card">226523531-232-MDL</option>

                    </select>

For now I was only found how to do it knowing the options, like this:

browser.option(:text,'226523531-232-MDL').click

Aucun commentaire:

Enregistrer un commentaire