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
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. My version is Version 133.0.3065.92.
- Update if you are using an older version. Note the version number (e.g., 133.x.x.x).
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 For Selenium WebDriver
- Go to the official Microsoft Edge WebDriver page:
- As per your Edge browser version and OS, download the corresponding EdgeDriver from the stable channel.
Step 3: Extract and Set Up EdgeDriver
- Extract the EdgeDriver ZIP file to a location like D:\WebDriver\
- Inside the folder, you’ll find msedgedriver.exe.
- 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.
Step 4: Run EdgeDriver with Selenium
// 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();
- Open Edge automatically when running the Selenium test.
- Navigate to websites.
- Extract page titles & interact with web elements.