I created this test script because I was having issues with another script
that needed to work with select_list. This is having the same issue. From
my understanding "contents[0]" should print out "Firefox" but instead I get
a memory location. I printed the "memory" location out and it's not a
simple array of the options it almost looks like the browser object.
I wanted to know if this was a known issue or is my understanding incorrect
on options returning an array?
## Output
#<Watir::Option:0x816f138>
[
[0] "test",
[1] "one",
[2] "two",
[3] "three"
]
## Test Script
require 'rubygems'
require 'ap'
require 'watir-webdriver'
url =
"https://spreadsheets.google.com/viewform?hl=en&formkey=dDliTk5XU1R4RUMtb2c1WDZxWHNENmc6MQ#gid=0"
myArray = %w[test one two three]
b = Watir::Browser.new :firefox, :profile => 'LoL'
b.goto url
contents = Array.new
contents = b.select_list(:name => 'entry.6.single').options
puts contents[0]
ap myArray
b.close
--
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]