How does one return a SelectList object by :name, :id, etc.

10 views
Skip to first unread message

pmneve

unread,
Oct 1, 2010, 4:30:12 PM10/1/10
to Vapir
Am currently using Watir and trying to see if Vapir (for firefox)
solves some browser new window issues. But to get that far I have to
traverse a login screen that uses three select lists which could
conceivably have options with the same text/value.

Current Watir command is

browser.select_list(:class, strg).select(option)

With Watir I can do this too:

a_select_list = browser.select_list(:class, strg)
a_select_list.select(option)

How would I do either of these?

pat

Ethan

unread,
Oct 1, 2010, 5:00:24 PM10/1/10
to va...@googlegroups.com
The API is exactly the same in Vapir. Vapir aims to keep compatibility with the Watir API in almost every instance. 

pmneve

unread,
Oct 1, 2010, 7:27:26 PM10/1/10
to Vapir
Unfortunately I got this error when using the command:

browser.select_list(:name, 'selBox').select('SIT2345')

undefined method 'select_list' for #<Vapir::Firefox:0x60859ac>

works with FireWatir 1.6.5

pat

On Oct 1, 2:00 pm, Ethan <notet...@gmail.com> wrote:
> The API is exactly the same in Vapir. Vapir aims to keep compatibility with
> the Watir API in almost every instance.
>

pmneve

unread,
Oct 1, 2010, 7:45:24 PM10/1/10
to Vapir
Nathan,
I used
require 'vapir-common'
require 'vapir-ie'
require 'vapir-firefox'
instead of
require 'watir-vapir'
and apparently that solved that issue.
Thanks for your help!
pat

Ethan

unread,
Oct 1, 2010, 7:50:58 PM10/1/10
to va...@googlegroups.com
That is very strange - #select_list works fine for me (and always has). 
Can you send the full script that you are using, and the full error message + backtrace? 
Also, do other element types work (#div, #text_field, etc); is it only #select_list that is problematic? 

-Ethan

Ethan

unread,
Oct 1, 2010, 7:52:36 PM10/1/10
to va...@googlegroups.com
Ah, I'm glad that worked. watir-vapir is only there for compatibility with existing scripts that use Watir's namespace, so if you're just using Vapir, then it's not needed. 

I'll look into what might be going wrong with that, though. thanks for letting me know. 
Reply all
Reply to author
Forward
0 new messages