Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify installation of Firefox to use for watir-webdriver script execution

For testing purposes I have multiple Firefox installations/versions on one machine made by using Utilu FF collection.

If there`s

b = Watir::Browser.new :ff

in test script, it is automatically executed with oldest FF version which is 3.6.22 in my case. I was surprised, because I assumed that by default script will be executed in Windows default browser which is Firefox6 not Firefox 3.6.22.

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

like image 836
mihijs Avatar asked Sep 08 '11 10:09

mihijs


2 Answers

You can specify a path to your firefox executable:

require 'watir-webdriver'
Selenium::WebDriver::Firefox.path = "/path/to/firefox.exe"
b = Watir::Browser.new :firefox
like image 135
Alister Scott Avatar answered Oct 24 '22 12:10

Alister Scott


For those using chromedriver use:

Selenium::WebDriver::Chrome.driver_path = "path/to/chromedriver"
like image 2
joost Avatar answered Oct 24 '22 12:10

joost