You can also do it like this: b.select_list(:id, 'blah').options.map(&:value)
Jarmo Pertman ----- IT does really matter - http://itreallymatters.net On Thursday, November 22, 2012 6:32:24 AM UTC+2, Oscar.Rieken wrote: > > I have a few questions. > Why would you want to collect the values to make sure they are in the > select? what if they are not in the right order? what if the text and the > values do not match up correctly? > > what value is this test really giving? > > but to answer your question which you were on the right track. something > like this could work > > select_list = b.select_list(:id, 'blah') > select_list.options.collect{ |i| i.attribute_value("value")} > > > On Wed, Nov 21, 2012 at 11:06 PM, Adrian Killens > <ack...@googlemail.com<javascript:> > > wrote: > >> It looks like this and I'd live to get an array of 1, 2, 3 rather than >> Thing One, Thing Two, Thing Three. >> >> <select name="things" size="1" onchange="#" id="things" class="test"> >> <option value="1">Thing One</option> >> <option value="2">Thing Two</option> >> <option value="3">Thing Three</option> >> </select> >> >> Hope that makes sense. >> >> >> On Thursday, 22 November 2012 00:37:33 UTC, Oscar.Rieken wrote: >> >>> what does the html of the select list look like >>> >>> >>> On Wed, Nov 21, 2012 at 5:14 PM, Adrian Killens >>> <ack...@googlemail.com>wrote: >>> >>>> I can do it with options like this: >>>> >>>> selectList = b.select_list(:id, 'blah') >>>> selectContent = selectList.values.map(&:text) >>>> b.select(:id, 'blah').select_value(**selectContent[1]) >>>> >>>> >>>> But was wondering how I could do the same thing using the value rather >>>> than just the option? >>>> >>>> Cheers >>>> Aidy >>>> >>>> -- >>>> Before posting, please read http://watir.com/support. In short: search >>>> before you ask, be nice. >>>> >>>> watir-...@googlegroups.com >>>> http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general> >>>> watir-genera...@**googlegroups.com >>>> >>> >>> -- >> Before posting, please read http://watir.com/support. In short: search >> before you ask, be nice. >> >> watir-...@googlegroups.com <javascript:> >> http://groups.google.com/group/watir-general >> watir-genera...@googlegroups.com <javascript:> >> > > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com