3

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

Jeff
  • 31
  • 2

2 Answers2

4

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
  • 56,372
  • 28
  • 94
  • 125
  • 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 Oct 21 '10 at 10:00
  • Looks like I'll need to start the switch over to web-driver as I've run into the same issue. – Alastair Montgomery Feb 03 '11 at 13:52
1

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
  • 66
  • 1