Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby Watir could not find firefox binary

Using ruby 1.9.3 and the latest version of watir-webdriver i get the following error when running a test script:

C:/.../selenium/webdriver/firefox/binary.rb:120in 'path': Could not find Firefox binary (os-windows). Make sure Firefox is installed or set the path manually with Selenium::Webdriver::Firefox::Binary.path=

I only just started getting this error after installing an older version of firefox in addition to a current version. I am using watir-webdriver NOT selenium webdriver. Here are my requires

require 'highline/import'
require 'watir-webdriver'
require 'win32console'
require 'term/ansicolor'
require 'base64'

Error is with this line:

browser = Watir::Browser.new :ff

I have uninstalled all versions of firefox and Ruby, and reinstalled only the latest. The firefox installation directory is in my PATH. Thanks in advance for any ideas.

like image 803
user2394397 Avatar asked Dec 03 '25 03:12

user2394397


1 Answers

Added this line after my 'requires' section and it works

Selenium::WebDriver::Firefox::Binary.path='C:\Program Files (x86)\Mozilla Firefox\firefox.exe'
like image 119
user2394397 Avatar answered Dec 04 '25 18:12

user2394397



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!