Error message: “'chromedriver' executable needs to be available in the path”

+1 vote

I've written my Selenium code on Python and also downloaded the chromedriver.exe for my windows OS from here: http://chromedriver.storage.googleapis.com/index.html?path=2.15/

I extracted the downloaded zip file, and then put the path to the exe (C:\Users\michael\Downloads\chromedriver_win32) into the Environment Variable "Path". However, I get an error when I run this code:

  from selenium import webdriver
  driver = webdriver.Chrome()

Error log:

WebDriverException: Message: 'chromedriver' executable needs to be available in the path. Please look at     http://docs.seleniumhq.org/download/#thirdPartyDrivers and read up at http://code.google.com/p/selenium/wiki/ChromeDriver

But I think I've done everything correct. Can someone help me out here?

Apr 30, 2018 in Selenium by kappa3010
• 2,070 points
5,422 views
Hi,

Please download the Chrome driver from here as per your Operating System :
https://chromedriver.storage.googleapis.com/index.html?path=2.45/

Please unzip 'chromedriver_XXXX' and put 'chromedriver.exe' in 'C:\Python27\Scripts' folder.
If you follow this step, then you need not to provide the path of the driver, just invoke the driver using the following code :

driver= webdriver.Chrome()

Thanks,

Manish

1 answer to this question.

0 votes

Okay there are a couple of wrong doings here. 
1. You don't need to set your environment variables for chromedriver.exe. This is an executable.
2. The reason for your error is because you have to provide the path to chromedriver.exe in your code. Do it using System.setProperty().
3. And if your doing it using Elipse IDE, then remember that your path to chromedriver.exe will have to double slashes everywhere and not single slashes which is how usually the path is.

Below code is how you should do it.

System.setProperty("webdriver.chrome.driver", "C:\\Users\\michael\\Downloads\\chromedriver_win32.exe");
WebDriver driver = new ChromeDriver();
answered Apr 30, 2018 by king_kenny
• 3,650 points

Related Questions In Selenium

0 votes
1 answer
0 votes
0 answers
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,430 points
1,199 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,510 points
1,283 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,510 points
1,041 views
0 votes
1 answer

How to open a browser windows silently in the background?

It is a little bit of a ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,650 points
467 views