Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

How To Launch Microsoft Edge Browser In Selenium WebDriver – Java

Posted on 03/16/2025 By admin

Selenium automates a browser. There are multiple browsers supported by Selenium WebDriver. Major browsers are – Google Chrome, Mozilla Firefox, Microsoft Internet Explorer, Microsoft Edge, Opera, and Safari. In this post, we will learn to “Launch a Microsoft edge browser in Selenium WebDriver 3 and 4“.

Edge is a web browser developed by Microsoft. It was initially released for Windows 10 as a successor for Microsoft’s Internet Explorer (IE). Microsoft Edge was rebuilt as a Chromium-based browser in 2019. Chromium is a product by Google which they used to build Google Chrome and the same is used to building Microsoft Edge now. Even Opera browser is also based on Chromium.

Now Microsoft Edge is not just for Windows it is available for Mac, iOS, and Android. Initial developed Microsoft Edge is referred to Microsoft Edge Legacy now.

If you are using Windows 10 OS then most probably you will be using Microsoft Edge Legacy. To confirm you check the Edge logo and version. If you are using Mac or Windows 7, 8, and 8.1 then you can download from here. Downloading and installing is quite easy.

Since we will use Java binding of Selenium WebDriver to launch an Edge browser, please set up a Selenium Java project as discussed here.

Selenium WebDriver provides corresponding classes for browsers. For example:- For Chrome -> ChromeDriver, For Firefox -> FirefoxDriver, For Edge -> EdgeDriver. To launch any browser through Selenium WebDriver we just need to create an object of their corresponding class.

package BasicSeleniumConcepts;

import org.openqa.selenium.edge.EdgeDriver;

public class LaunchMicrosoftEdge {
        
        public static void main(String[] args) {
                EdgeDriver edgeDriver = new EdgeDriver();
                edgeDriver.get("https://www.google.com/");
        }

}

We were expecting that an edge browser should have launched but we got an exception IllegalStateException and states that “The path to the driver executable must be set by the webdriver.edge.driver system property“.

Selenium WebDriver can not communicate with a browser directly. We need an intimidatory executable agent between Selenium WebDriver and the actual browser. These intimidatory are provided by third parties. For edge, we need a msedgedriver as an interface between Selenium WebDriver and a real edge browser.

There is a critical part that for each version of the Edge browser, you may have different msedgedriver executable version. Many times you may face issues when Selenium will not be able to create a WebDriver session and maximum time reason is an incompatibility of Edge browser version and msedgedriver version.

I will advise you to download the latest Edge browser and msedgedriver always. If you are using an older version of Edge browser due to some restrictions always read release notes to know which msedgedriver version will support your current version of Edge browser.

I have below version of Edge browser installed on my system.

Let’s find a compatible version of msedgedriver for my installed version of edge. Remember this is just for reference. These versions will be changed with time. So just to follow the above process and download the correct version of msedgedriver.

Just click on the link as per your OS. It will start downloading. It is a zipped file that you need to unzip. After unzip you will get a msedgedriver.exe file as exe is an extension of executable file on Windows. For Mac there will be no extension as they follow permission-based capability to identify an executable file.

Note:- You can rename this file whatever you want. There are no restrictions that you can not change its name. Many beginners get confuse on this. You just need to use the changed name in your program.

Before launching an Edge browser you need to let WebDriver know explicitly the location of msedgedriver executable file. As of now, we will add the path of msedgedriver as a system property. There are some other ways as well which we will see later. Any System property is set as a key-value pair and to set path of msedgedriver, selenium WebDriver has a key as “webdriver.edge.driver”. Remember you can not change the key to some other name.

Remember we need to set a path of msedgedriver with the extension of it if available. It is needed for Windows but for Mac, you need to give it executable permission.

package BasicSeleniumConcepts;

import org.openqa.selenium.edge.EdgeDriver;

public class LaunchMicrosoftEdge {
        
        public static void main(String[] args) {
                
                // Set the path of edgeDriver with extension for windows
                System.setProperty("webdriver.edge.driver", "C:\\Users\\amomahaj\\Downloads\\edgedriver_win64 (1)\\msedgedriver.exe");
                EdgeDriver edgeDriver = new EdgeDriver();
                edgeDriver.get("https://www.google.com/");
        }

}

You can see logs are similar as we get for Chrome browser because Microsoft Edge is now chromium based. You can also see a similar message on the browser “Microsoft edge is being controlled by automated test software”.

Since Microsoft Edge is a Chromium based browser, Class EdgeDriver extends Class ChromiumDriver like ChromeDriver class.

You can download/clone the above sample project from here.

If you have any doubt, feel free to comment below.If you like my posts, please like, comment, share and subscribe.#ThanksForReading

#HappyLearning

Uncategorized

Post navigation

Previous Post: Jobs Information
Next Post: SELENIUM INTERVIEW QUESTION 6 – All Ways to Exclude/Ignore/Disable a Test Method in TestNG

Related Posts

Hierarchy of Selenium Classes and Interfaces – Make Selenium Easy Uncategorized
REST Assured Tutorial 26 – How To Use Java Object As Payload For API Request Uncategorized
image – Make Selenium Easy Uncategorized
image – Make Selenium Easy Uncategorized
Selenium Interview Question 9 – Difference Between getWindowhandle() and getWindowHandles() Uncategorized
February 24, 2019 – Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark