How to download chromedriver for selenium (Step-by-Step Guide)

Are you looking to automate tests with Selenium but can’t get the correct version of ChromeDriver? You’re not alone.

Many testers and developers are struggling with errors like:

❌ SessionNotCreatedException: This version of ChromeDriver only supports Chrome version X

❌ chromedriver executable needs to be in PATH

Here is the solution. 

This article will teach you how to download, install, and set up ChromeDriver for Selenium in Windows, Linux, and MAC OS (without errors).

Step 1: Check Your Chrome Version

It is necessary to check your Chrome version before downloading chromedriver.

How to Check Chrome Version

There are two methods to check the Chrome browser version.

Method 1:

  • Open Google Chrome.
  • Type chrome://settings/help in the address bar.
  • Look for the Version Number (e.g., My current chrome browser version: 134.0.6998.89)
Check chrome version for selenium

Method 2:

Click on the three dots at the top-right corner of Chrome browser. It will open the menu.

Click three dots chrome browser

Select setting from the menu.

Select settings

It will open the Chrome settings page.

On the settings page, you will find the About Chrome menu at the bottom-left corner.

Click on it.

On the About Chrome page, you can see your Chrome browser’s version as shown in a given image.

chrome settings page

Why does this matter?

Because ChromeDriver must match your Chrome version. If they do not match, you might get an error when executing your Selenium test.

Tips: Always use the latest version of Google Chrome and a latest stable release version of Chromedriver to minimize errors.

Update on Latest stable version release: Version 134.0.6998.88 of ChromeDriver and Chrome browsers are available to download.

Learn a detailed guide on what is WebDriver in Selenium.

Step 2: Download the Correct ChromeDriver

Now, let’s download the right version of ChromeDriver.

Find the ChromeDriver version that matches your Chrome browser and OS, and download the right file for your system:

Download chromedriver from official website
Choose your OS:
  • Windows: chromedriver-win64.zip
  • Mac (Intel or ARM): chromedriver-mac-x64.zip / chromedriver-mac-arm64.zip
  • Linux: chromedriver-linux64.zip

Copy URL from the table as per your OS and Chrome browser’s version and open it in the browser. 

open chromedriver download url

It will download the Zip file.

chromedriver win64 zip folder

Once downloaded, extract the ZIP file to get the chromedriver executable.

unzip the zip folder

ChromeDriver unzip

Open extracted folder. You will get the chromedriver.exe (Executable file) file inside it.

chromedriver exe file

Tip: Store chromedriver in a folder from where you can access it easily, like D:/chromedriver/

Step 3: Install and Set Up ChromeDriver in Selenium

Now that you have ChromeDriver, but Selenium doesn’t know where it is. You need to tell Selenium where to find it.

There are two options.

Option 1: Set Chromedriver Path in Environment Variable

  • Search for Edit the system environment variables from Windows search.
  • Click on Environment Variable button from Advanced tab.
  • Select Path from System Variables section and click on Edit button.
  • Click on the New button and set Chromedriver Path as shown in the image below and click OK.

That’s it.

Set chromedriver path

Option 2: Specify ChromeDriver Path in Code

If you don’t want to modify system settings, you can also manually set the path in Selenium code. Here is an example:
        System.setProperty("webdriver.chrome.driver", "D:\chromedriver.exe");
	WebDriver driver= new ChromeDriver();		
        driver.get("https://only-testing-blog.blogspot.com/");


Note
: Replace “D:\chromedriver.exe” with the path where you extracted ChromeDriver.

The Easy Way – Use WebDriver Manager

It is annoying to download ChromeDriver and all other drivers manually every time the browser version updates. Instead of manually downloading ChromeDriver, let WebDriver Manager handle everything:
Here’s a way:

Install WebDriver Manager in Eclipse

If you are using Java with Eclipse, you can create a Maven Project and add WebDriver Manager Dependencies in the pom.xml file:

Now, you can use WebDriver Manager in your Selenium tests.
    // Automatically download and setup ChromeDriver
    WebDriverManager.chromedriver().setup();
        
    // Launch Chrome browser
    WebDriver driver = new ChromeDriver();

Downloading Older/Previous Versions of ChromeDriver

Note: It is not recommended to use older versions of ChromeDriver. 

Recently I was looking to download the previous version of ChromeDriver to verify browser compatibility for one of our under development websites. 

I found a reliable source to download older versions of ChromeDriver after 2+ hours of Google search. So I thought, let me share it with all of you guys.

When you open that page, it contains direct download URLs of ChromeDriver for all previous version releases.

Example: If you are looking to download chromedriver 131.0.6724.0, you will find a URL like below on that page. You can open it in your browser to start download.

https://storage.googleapis.com/chrome-for-testing-public/131.0.6724.0/win64/chromedriver-win64.zip

Similarly, you will find separate ChromeDriver download URLs for all older versions like 128, 129, 130, etc, for Linux, macOS, and Windows.

Common Errors and Fix

Error: SessionNotCreatedException – ChromeDriver version mismatch

Fix: Download the correct ChromeDriver version matching your Chrome browser.

Error: chromedriver executable needs to be in the PATH

Fix: Add ChromeDriver to the system PATH or specify its full path in your code.

Error: selenium.common.exceptions.WebDriverException

Fix: Update ChromeDriver or use WebDriver Manager.

Frequently Asked Questions (FAQs)

Question: Where can I download the latest ChromeDriver?
Answer: You can download the latest ChromeDriver from the official Google ChromeDriver website: https://googlechromelabs.github.io/chrome-for-testing/
Question: How do I check my Chrome version?
Answer: Go to chrome://settings/help, and your Chrome version will be displayed.
Question: How do I fix the “ChromeDriver executable needs to be in PATH” error?
Answer: Either add ChromeDriver to your system environment variable PATH or specify its full path in your Selenium script.
Question: What is the easiest way to install ChromeDriver?
Answer: Use WebDriver Manager. It will automatically download and update ChromeDriver.
Question: How to fix ChromeDriver version mismatch?
Answer: The ChromeDriver version mismatch error occurs when a version of ChromeDriver and your Chrome browser do not match. To resolve this ChromeDriver compatibility error, follow these steps.
  1. Check Your Chrome Browser Version: Go to Chrome browser’s help section and check version. Update version if using older one.
  2. Download the Matching ChromeDriver Version: Go to the official Chrome driver download page as discussed earlier in this article. Download latest version.
  3. Update ChromeDriver in Your Project: Update the latest downloaded Chrome driver executable file in your project.
Question: What should I do if ChromeDriver keeps crashing or does not launch Chrome?
Answer: To fix this issue, update your Chrome browser and chromedriver to the latest stable version. Also, check if you are using any browser extension that conflicts with the current version.
Question: How do I run ChromeDriver with a specific user profile?
Answer: Use the –user-data-dir argument in Chrome options.
Question: How to check installed version of Chrome driver?
Answer: Steps to check Chrome driver version, 
  • Open the Command Prompt (Windows) or Terminal (Mac/Linux).
  • Type command: chromedriver –version.
  • Press Enter.
Command prompt will display installed ChromeDriver version number.

Now you’re all set to run Selenium tests without errors!

Have any issues? Drop a comment below!

Leave a Reply

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