Re: [wtr-general] Can you create an array from the values in a select list?

2012-11-26 Thread Adrian Killens
Perfect! Thank you :-) -- 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

Re: [wtr-general] Can you create an array from the values in a select list?

2012-11-22 Thread Jarmo Pertman
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

[wtr-general] Can you create an array from the values in a select list?

2012-11-21 Thread Adrian Killens
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 --

Re: [wtr-general] Can you create an array from the values in a select list?

2012-11-21 Thread Oscar Rieken
what does the html of the select list look like On Wed, Nov 21, 2012 at 5:14 PM, Adrian Killens ack...@googlemail.comwrote: I can do it with options like this: selectList = b.select_list(:id, 'blah') selectContent = selectList.values.map(:text) b.select(:id,

Re: [wtr-general] Can you create an array from the values in a select list?

2012-11-21 Thread Adrian Killens
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=1Thing One/option option value=2Thing Two/option option value=3Thing Three/option /select Hope that makes sense. On

Re: [wtr-general] Can you create an array from the values in a select list?

2012-11-21 Thread Oscar Rieken
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