Selenium: Resolving chrome webdriver.py error / throwing exception on python selenium

Operating System, Programming, Technology

Problem:

while running a selenium script, webdriver.py always throwing exception like :

File "C:\Python27\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 67, in __init__
desired_capabilities=desired_capabilities)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 87, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 141, in start_session
'desiredCapabilities': desired_capabilities,

even if I already used the correct chromedriver location:

browser = webdriver.Chrome("C:/Python27/chromedriver.exe")

the error still showed up.

Solution:

After several hours looking for solution, I solved the problem by using the latest version of chromedriver.

At the moment I wrote this article, my current chrome version is v54, so I used chromedriver v2.25 which the release notes stated it supports Chrome v53-55.

Download chromedriver v2.25

Hope this help.

P.S

I tested on both mac OS and windows and it worked.

Leave a Reply

Your email address will not be published. Required fields are marked *