Using watir to manage multiple instances of firefox

I am using watir on a Windows environment with FireFox 3.6 through FireWatir. I can successfully run one watir test without any problems. I need to be able to:

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

or

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

Currently, attempts for both a and b cause both Browser.new commands to return the same browser instance, so the scripts switch to each other.

Are any of these scenarios possible? I have seen several posts from 2008/2009 on a branch of several browsers, has this code been finalized in the general release?

Thank,

Jeff

+3
source share
2 answers

I 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/"
+4
source

Vapir-firefox is an improved version of Firewatir that fixes multiple window processing issues (among many other improvements).

http://vapir.org/

+1
source

Source: https://habr.com/ru/post/1770568/


All Articles