close

How do I install ChromeDriver on Windows 10 and run Selenium tests with Chrome?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How do I install ChromeDriver on Windows 10 and run Selenium tests with Chrome in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How do I install ChromeDriver on Windows 10 and run Selenium tests with Chrome?

  1. How do I install ChromeDriver on Windows 10 and run Selenium tests with Chrome?

    As Uri stated in the question, under Update #2, downloading the latest release of chromedriver and placing it in C:\Windows corrects the issue.

  2. install ChromeDriver on Windows 10 and run Selenium tests with Chrome

    As Uri stated in the question, under Update #2, downloading the latest release of chromedriver and placing it in C:\Windows corrects the issue.

Method 1

As Uri stated in the question, under Update #2, downloading the latest release of chromedriver and placing it in C:\Windows corrects the issue.

I had the same issue with Chrome hanging when the browser window opens (alongside a command prompt window).

Method 2

  1. Download the chromedriver.exe and save it to a desired location
  2. Specify the executable_path to its saved path

The sample code is below:

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('headless')
driver = webdriver.Chrome(executable_path="path/to/chromedriver.exe", chrome_options=options)
driver.get("example.html")
# do something here...
driver.close()

As Uri stated in Update #2 of the question, if we put the chromedriver.exe under C:/Windows, then there is no need to specify executable_path since Python will search under C:/Windows.

Conclusion

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read