This may be a little kludgy but worth a try.  You will have to make the
object names what are in you page...

list_one = []
list_one = $ie.select_list( :name, 'list1').getAllContents
# Get the contents of the first selectlist and randomly select one
cnt = rand(list_one.length)
# If there is a placeholder item at the topmost selectlist position
bypass it
next if "#{list_one}" == ("-- Select One --")
$ie.selectBox( :name, 'list1').select("#{list_one[cnt]}")
# Wait for the selected item and until next selectlist is populated
Sleep 1
list_one = nil

# Get the contents of the second selectlist and randomly select one
list_two = []
list_two = $ie.select_list( :name, 'list2').getAllContents
cnt = rand(list_two.length)
# If there is a placeholder item at the topmost selectlist position
bypass it
next if "#{list_two}" == ("-- Select One --")
$ie.selectBox( :name, 'list2').select("#{list_two[cnt]}")
# Wait for the selected item and until next selectlist is populated
Sleep 1
list_two = nil
                                
# Get the contents of the third selectlist and randomly select one
list_three = []
list_three = $ie.select_list( :name, 'list3').getAllContents
cnt = rand(list_three.length)
# If there is a placeholder item at the topmost selectlist position
bypass it
next if "#{list_three}" == ("-- Select One --")
$ie.selectBox( :name, 'list3').select("#{list_three[cnt]}")
list_three = nil 

Hope this helps,

--Mark


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

Thanks for the suggestion!

My problem is that the first value in the second list could be one of
many different values, depending on what the selection in the first list
is.  I just want to select the first value, no matter what it is.

-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

Reply via email to