How to Download EdgeDriver for Selenium (Step-by-Step Guide)

You need EdgeDriver to run Selenium tests in Microsoft Edge browser. It lets Selenium WebDriver interact with MS Edge browser just like a real user.

Here is a step-by-step guide to download, install, and set up the right version of EdgeDriver.

Step 1: Check Your Microsoft Edge Version

Before downloading EdgeDriver, you must check your Edge browser version.

Here’s how to check:

  • Open Microsoft Edge.
  • Click the three dots (⋮) at the top right corner - Select Help and Feedback - Select About Microsoft Edge.
  • Update if you are using an older version. Note the version number (e.g., 133.x.x.x).
Check microsoft edge browser version

Why does this matter?

Because EdgeDriver version updates with a version of the Edge browser, and a mismatch in versions can generate errors when you run Selenium tests.

Now let’s see how to download the correct version of EdgeDriver.

Are you looking to run selenium tests in Firefox browser? Here is a step-by-step guide on how to download and set up GeckoDriver for Selenium.

Step 2: Download EdgeDriver

To download EdgeDriver, follow these simple steps:
Download Edge Driver

Now let's see how to set up the edge driver.

Step 3: Extract and Set Up EdgeDriver

Once downloaded, you need to extract the ZIP file.
  • Extract the EdgeDriver ZIP file to a location like D:\WebDriver\
  • Inside the folder, you’ll find msedgedriver.exe.
But to run EdgeDriver in your selenium tests, you need to add it to the system PATH.

Here’s how:
  • Search for Environment Variables in Windows.
  • Under System Variables, find Path and click Edit.
  • Click New, then paste your folder path (e.g., D:\WebDriver\).
  • Click OK and restart your computer.
Now, EdgeDriver is ready to run.

Step 4: Run EdgeDriver with Selenium

To make sure EdgeDriver is working, let’s write a quick Selenium test script. Use the given edge driver set up code in your selenium test and run it. 

        // Set the path to EdgeDriver (only needed if it's not in system PATH)
        System.setProperty("webdriver.edge.driver", "D:\\WebDriver\\msedgedriver.exe");

        // Initialize EdgeDriver
        WebDriver driver = new EdgeDriver();
This example script will help you to run Selenium test in Microsoft Edge. Now, you can:
  • Open Edge automatically when running the Selenium test.
  • Navigate to websites.
  • Extract page titles & interact with web elements.
Tip: Always use the latest Selenium version and update EdgeDriver whenever Edge browser's version updates.

No comments:

Post a Comment