Below is the sample code to launch edge browser using Microsoft driver
package com.Sample;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.testng.annotations.Test;
public class EdgeBrowserTest {
String driverPath = "Path Microsoft edge driver"; // D:\\microsoftdriver\\
public WebDriver driver;
@Test(priority=0)
public void launchEdgeBrowser() {
System.out.println("===== Microsoft Edge browser =======");
System.setProperty("webdriver.edge.driver", driverPath+"MicrosoftWebDriver.exe");
driver = new EdgeDriver();
}
@Test(priority=1)
public void openEdgeBrowser() {
driver.navigate().to("http://seleniummansion.blogspot.com/");
}
@Test(priority=2)
public void closeDriver() {
if(driver!=null) {
driver.close();
}
} }