To install the ChromeDriver for Selenium, you can follow these steps:
Step #1: Check Chrome Browser Version
- Open Google Chrome browser.
- Click on the three-dot menu at the top-right corner.
- Go to “Help” > “About Google Chrome“
- Note down the version number.
Alternatively, you can check the Chrome version and other details by going to the below address (Chrome URL address bar)
chrome://version/
Step #2: Download ChromeDriver
- Visit the ChromeDriver download page: https://sites.google.com/chromium.org/driver/downloads
- Find the version of ChromeDriver that matches your Chrome browser version.
- Click on the link to download the ChromeDriver executable file. Choose the appropriate file for your operating system (Windows, macOS, or Linux).
Step #3: Set Up ChromeDriver
- Once the ChromeDriver executable file is downloaded, extract the contents if it’s in a compressed format (e.g., ZIP file).
- Move the extracted file to a desired location on your computer.
Step #4: Add ChromeDriver to System Path (Windows)
- Right-click your desktop’s “This PC” or “My Computer” icon.
- Select “Properties” from the context menu.
- Click on “Advanced system settings” on the left sidebar.
- In the System Properties window, click the “Environment Variables” button.
- In the “System Variables” section, scroll down and find the “Path” variable.
- Click “Edit” or “New” to add a new entry.
- Enter the path to the folder where you saved the ChromeDriver executable file (e.g., C:\path\to\chromedriver).
- Click “OK” to save the changes.
Step #5: Verify ChromeDriver Installation
- Open a command prompt or terminal window.
- Type the following command and press Enter.
chromedriver --version
If you see the version number printed in the output, ChromeDriver is installed and accessible from the command line.
You have now installed ChromeDriver for Selenium. You can use it in your Selenium scripts to automate Chrome browser interactions.