How to launch Edge browser with Selenium Webdriver?

We can launch Edge browser with Selenium webdriver by using the Microsoft webdriver. We should also ensure that we are having the machine with the Windows 10 operating system.

Navigate to the below link to download the Microsoft Edge driver executable file −

Once the page is launched, scroll down to the Downloads section, then choose and click the link which is compatible with our local Edge browser version.

A zip file gets created, once the download is completed successfully. We have to then unzip the file and save it in a desired location. Then, set the path of the msedgedriver.exe file. This is done by utilizing the System.setProperty method.

Finally we have to create an instance of the EdgeDriver class.


WebDriver d = new EdgeDriver();


import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
public class EdgeBrwser{
   public static void main(String[] args) {
      //set path of msedgedriver.exe path
      //instance of EdgeDriver
      WebDriver driver = new EdgeDriver();
      //URL launch