We use select in our tests.  It's a method in the Watir::SelectList class.
As usual, there is more than one way to solve the task.

Cheers,
Jason

On 6/22/07, Adam Reed <[EMAIL PROTECTED]> wrote:

Tiffany,

        I don't believe 'select' is a valid action on a select list
(ironically enough).  In my tests, I use:

        $ie.select_list(:name,
"list2").value="the_name_of_the_entry_here"

Thanks,
Adam

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tiffany Fodor
Sent: Friday, June 22, 2007 12:27 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Select the first item in a list

Hi all!

I have a group of three tiered select lists - the first one defines what
values will appear in the second and then the value selected in the
second defines what values will appear in the third.  For my testing, I
don't really care what value is selected in the second and third lists,
I just want to select the first entry.

I've tried $ie.select_list(:name, "list2").select(:index, "1"), but I
get a "wrong number of arguments" error.

I've also tried adding the contents of the list to an array and setting
the value using the array, but the array values are nil.

intermediateValues = [$ie.select_list(:name, "list2").getAllContents]
puts intermediateValues[1] $ie.select_list(:name,
"list2").select(intermediateValues[1])

Any help would be greatly appreciated!

Thanks!

-Tiffany
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to