0
pry(main)> browser =Watir::Browser.new(:chrome)

Error

Selenium::WebDriver::Error::WebDriverError:  Unable to find chromedriver. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
from /home/roberto/.rvm/gems/ruby-2.4.1/gems/selenium-webdriver-3.12.0/lib/selenium/webdriver/common/service.rb:57:in `binary_path'

I have already installed and added the path for chrome driver however, I keep receiving this error, can someone highlight what i am missing.

Rajagopalan
  • 5,465
  • 2
  • 11
  • 29

1 Answers1

0

You need to download the chrome driver and put it in your bin folder, please go the path specified and download the chrome driver and then paste that to your bin folder. C:\Ruby\bin is what my path, likewise check your path and place chromedriver.exe file into bin folder

Setting binary path

Selenium::WebDriver::Firefox::Binary.path = 'C:\Ruby24-x64\bin C:\Users\farid\AppData\Local\Google\Chrome\application\chrome.exe'
Rajagopalan
  • 5,465
  • 2
  • 11
  • 29
  • this is my path, C:\RailsInstaller\Ruby2.3.3\bin as well the path for chrome C:\Users\farid\AppData\Local\Google\Chrome\application –  May 11 '18 at 03:43
  • @Farida Yes then paste your chrome driver there, it would work. – Rajagopalan May 11 '18 at 03:44
  • chromedriver already in the path, i can access to it direct and open properly on its port, however, I can;t let watir opens it –  May 11 '18 at 03:45
  • Okay actually you need give the binary path since your chrome is not in the program files, give me an hour once I reach office I will you that code. – Rajagopalan May 11 '18 at 03:47
  • you are the best –  May 11 '18 at 03:49
  • here is my path list: C:\RailsInstaller\Git\cmd C:\RailsInstaller\Ruby2.3.3\bin C:\Ruby24-x64\bin C:\Users\farid\AppData\Local\Google\Chrome\application _______ so ruby is installed using RailsInstaller and the Chromedriver is in the chrome application –  May 11 '18 at 03:53
  • @Farida I have updated the binary path for you, Can you check it now? – Rajagopalan May 11 '18 at 05:11
  • @Rajagppalan : it didn't work, i got the same error –  May 12 '18 at 00:42
  • @Farida take the binary path you specified and then paste it in the address bar and press enter and see whether chrome opens. – Rajagopalan May 12 '18 at 02:47
  • I did paste : C:\users\farid\AppData\Local\Google\Chrome\application\chrome.exe the browser : your file was not found. however, if I click on the file manually, it will launch the console Starting ChromeDriver (v2.9.248315) on port 9515 –  May 13 '18 at 00:12
  • 1
    @Farida I am not asking you to click , I am asking you copy this path and paste it in address bar and then press enter button and see whether chrome opens! – Rajagopalan May 13 '18 at 00:16
  • Rajagoplan: I reinstalled everything and now it works, thank you i had to reinstall, Ruby, rails, rvm and chromedriver and all the gems . Thank you –  May 13 '18 at 03:56
  • 1
    @Farida Okay, you are welcome. – Rajagopalan May 13 '18 at 04:25