Watir can't find mozilla geckodriver

I use Watir to scan something, but it throws

Unable to find Mozilla geckodriver. Please download the server from https://github.com/mozilla/geckodriver/releases and place it 

I took the next step.

Download the latest version of firefox (version50.0)

Download the latest version of geckodriver from https://github.com/mozilla/geckodriver/releases and put it in ~/geckodriver

Then add export PATH=$PATH:~/geckodriver to ~/.bash_profile and submit it.

Here is the code that I executed

 require 'watir-webdriver' browser = Watir::Browser.new :firefox # should open a new Firefox window browser.goto 'http://nitrowriters.com/form/form.html' # or type the local path to your downloaded copy 

Gemfile

 source "https://rubygems.org" gem 'nokogiri' gem 'watir-webdriver' gem 'open_uri_redirections' gem 'selenium-webdriver' gem "watir", ">= 6.0.0.beta2" 

Environment: OSX 10.10

+7
ruby firefox selenium
source share
2 answers

I had the same problem with Linux Mint 17.2. I decided to move the geckodriver file from the extracted tar to usr/bin (for this you need to have root privileges).

For some reason, zsh will not find it if I defined it in my path variable. Maybe someone has a better solution, but for now it works.

+5
source share

If the geckodriver is in ~/ , just add ~/ to your path. Only directories should be in your path. He's probably looking for a geckodriver at ~/geckodriver/geckodriver

Also, if you are using the latest version of Watir (6), you just need require "watir" instead of require "watir-webdriver"

+3
source share

All Articles