Selenium 3 - Launch Edge browser using Microsoft Edge Driver

In the previous article, we have seen launching Firefox browser with Gecko driver using Selenium 3. Now let us try to launch Microsoft Edge browse using Selenium 3.

Before proceeding, to start using Webdriver with Microsoft Edge browser, make sure you have Windows 10 on your machine and download the specified Microsoft WebDriver server version for your build.

You can download latest version of Microsoft WebDriver from here. Make sure to check Edge version supported and download.

Once you download the file 'MicrosoftWebDriver.msi', Install it to get 'MicrosoftWebDriver.exe' file.

In order to launch Edge Browser, we need to specify the system property with the path of the MicrosoftWebDriver.exe file.

package com.test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.testng.annotations.Test;

public class ExampleThree {
	
	String driverPath = "<path to Microsoft edge driver>";
	public WebDriver driver;
	
	@Test(priority=1)
	public void launchBrowser() {
		System.out.println("launching Microsoft Edge browser");
		System.setProperty("webdriver.edge.driver", driverPath+"MicrosoftWebDriver.exe");
		driver = new EdgeDriver();
	}

	@Test(priority=2)
	public void openEdgeBrowser() {
		driver.navigate().to("http://www.google.com");
	}
	
	@Test(priority=3)
	public void closeDriver() {
		if(driver!=null) {
			driver.close();
		}
	}	
}
Selenium Tutorials: 

Comments

I am getting below mention issue, if i am trying to launch Firefox webdriver(48.0.2) with jdk 1.8

"Sep 10, 2016 1:36:41 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end"

and no browser is opening.

I have also seen similar kind of issue when you are executing your scripts in windows32 bit.

They have fix but still not released. Soon you should be able to download gecko driver v0.11

Gecko Driver v0.11 Released. Now it hasboth windows 32bit and 64bit versions.

Add new comment

Image CAPTCHA