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.

To see the edge browser version, Click on the three dots that you see on the top right corner on your edge browser (after address bar) and Settings link. You see version beside 'Microsoft EdgeHTML'. Looks like the below screenshot.

Edge browser info for selenium

Once you download the 'MicrosoftWebDriver.exe' file, copy driver path / location as we do to launch Chrome and Firefox browsers.

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.

Hi,
Can you please tell us which version of selenium you were using to launch EDGE browser.
I have tried with Selenium 3.4.0 and 3.8.1 but no luck.

I am not able to import "org.openqa.selenium.edge.EdgeDriver"

Is there any other pre-requisite or something which I have missed particularly.

Thanks in advance.

3.141.59

How to hide the edge browser window that I use python to control?

Im getting a pop up saying do you want to navigate from this page when I launch a browser and go to a page and try to enter a value

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.