views:

78

answers:

2

I'm using watir in a Windows environment with FireFox 3.6 via FireWatir. I can successfully run a single watir test without issue. I need to be able to either:

a. Create and manage multiple browser instances or tabs from a single test script

or

b. Run two test scripts simultaneously from separate instances of ruby

Currently attempts at both a and b result in both Browser.new commands returning the same browser instance, thus the scripts step all over one-another.

Are either of these scenarios possible? I've seen some posts from 2008/2009 about a multiple browser branch, did this code eventually make it into the general release?

Thanks,

Jeff

+1  A: 

I have just tried it with watir-webdriver gem (installation instructions), and it works:

$ irb
>> require "watir-webdriver"
=> true
>> b1 = Watir::Browser.new :ff
=> #<Watir::Browser:0x101574930 url="about:blank" title="">
>> b1.goto "google.com"
=> "http://www.google.hr/"
>> b2 = Watir::Browser.new :ff
=> #<Watir::Browser:0x1023658f0 url="about:blank" title="">
>> b2.goto "yahoo.com"
=> "http://www.yahoo.com/"
Željko Filipin
I tried the same script with FireWatir. Two Firefox windows opened, but google.com and yahoo.com were both opened in the same browser window. The other window was empty all the time.
Željko Filipin
+1  A: 

Vapir-firefox is a much-improved fork of Firewatir that resolves its issues with handling multiple windows (among many other improvements).

http://vapir.org/

Ethan