Hi,

I have figure it out.

Code...
names = $browser.select_list(:name,'communities').options

community_names_arr = Array.new

commuName = ""

name_number = 0

names.each do |name|

  puts commuName = "#{name_number}: #{name.text}"

  name_number = name_number + 1

end

this gives me the text to each option in the listbox.

On Oct 19, 1:18 pm, Joe Fl <[email protected]> wrote:
> Hi,
>
> I am trying to retrieve the values from a dropdown and can't.  I have
> tried the following:
>
> undefined method on getAllContents
> arr= $browser.select_list(:name,'communities').getAllContents.to_a
> puts n=  arr.length
>
> I get a response of 32 but I cannot use split method to get each name.
> names = $browser.select_list(:name,'communities').options
> puts names.length
>
> I was able to do it before but have forgotten how to and cannot find a
> solution to it in the group.
>
> Thank you,
> Joe

-- 
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]

Reply via email to