0
votes

I have a form that I am trying to select some drop down options using watir. I am having trouble finding the correct way to select these options (in this case "bob") using watir. Any suggestions?

<form action="blahsome.php" method="post">
<select onchange="clearFields();" size="1" name="credential">
<option>tom</option>
<option>bob</option>
<option>susan</option>
</select>
1

1 Answers

0
votes

Did you try Select#select:

browser.select_list(:name => 'credential').select('bob')

The value passed to select can be a string or regular expression that matches the options text or label.