sclevine / agouti

A WebDriver client and acceptance testing library for Go
MIT License
822 stars 105 forks source link

Feature Request: Documentation on picking a dropdown #210

Open snoby opened 4 years ago

snoby commented 4 years ago

It would be helpful if some documentation or example could show how to select an option from a dropdown select. For example here: http://jsfiddle.net/t0xicCode/96ntuxnz/

<select name="People" class="selectpicker" data-style="btn-default" data-width="100%" multiple>
    <option value="John">John</option>
    <option value="Paul">Paul</option>
    <option value="Mary">Mary</option>
    <option value="Jane">Jane</option>
    <option value="Elisa">Elisa</option>
</select>
$('.selectpicker').selectpicker();
$('.selectpicker').selectpicker('val', ['John', 'Paul']);

I guess you could add an ID to the select, but how would you walk the option value list and select it?

Please and thank you,