If you are a Selenium webdriver user, then you know very well that Selenium 3.0 launched with Microsoft Edge support. In order to launch Microsoft Edge browser using Selenium 3.0, we have to set the path of Microsoft WebDriver in system environment variable. Now let us see, how to do it programmatically.
We can set the path of WebDriver by using System class’s setProperty() method. We have to specify the key as “webdriver.edge.driver” and value should be the location of MicrosoftWebDriver.exe file on our machine. Let us see an example below to launch Microsoft Edge browser using Selenium 3.0 and Java:
public class TestClass {
public static void main(String[] args) {
//Here we are setting up the path for MicrosoftWebDriver.exe
System.setProperty(“webdriver.edge.driver”,”C:MicrosoftWebDriver”);
//Initialize Edge Driver
WebDriver driver = new EdgeDriver();
//Open Google home page in Edge Browser
driver.get(”
}
}