How to specify the installation of Firefox for use in the watir-webdriver script project

For testing purposes, I have several installations / versions of Firefox on the same machine created using the Utilu FF collection .

If exists

b = Watir::Browser.new :ff

in the test script, it automatically runs with the oldest version of FF, which in my case is equal to 3.6.22. I was surprised because I suggested that the default script will be executed in the default Windows browser, which Firefox6 is not Firefox 3.6.22.

How to specify which installation / version of Firefox should be used for the test Watir-webdriver script execution?

+5
source share
3 answers

You can specify the path to the firefox executable:

require 'watir-webdriver'
Selenium::WebDriver::Firefox.path = "/path/to/firefox.exe"
b = Watir::Browser.new :firefox
+8

, chromedriver, :

Selenium::WebDriver::Chrome.driver_path = "path/to/chromedriver"
+2

For phantoms:

Selenium::WebDriver::PhantomJS.path="/usr/bin/phantomjs"
0
source

All Articles