SelectList#include? works only by checking option elements text. So this should work: browser.select.include? "Mr"
I would do like this instead if wanting to make sure if option exists: browser.select.option(:value => "26").exists? Jarmo Pertman ----- IT does really matter - http://itreallymatters.net On Monday, October 22, 2012 4:33:51 PM UTC+3, Adrian Killens wrote: > > Legend!! > > On Monday, 22 October 2012 13:06:17 UTC+1, Adrian Killens wrote: >> >> <select name="title" id="title"><option value="-1"></option> >> <option value="26">Mr </option> >> <option value="27">Mrs </option> >> <option value="28">Miss </option> >> </select> >> >> How would I write a statement to do something if value 26 exists? >> >> I tried this and it didn't work: >> if b.select(:id, title).include?('26') >> <do something> >> end >> > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
