• Skip to main content
  • Skip to primary sidebar

AutomationTestingHub

Selenium, Appium, Cucumber and more !!!

Selenium 3 – Launch Edge Browser with MicrosoftWebDriver

August 24, 2016 by anish 6 Comments

With the release of Selenium 3.0 Beta version and newer versions of different browsers, there have been slight changes in the way you launch different browsers. In our previous article, we had described the process of launching Firefox with GeckoDriver. In this article you will see how to launch Microsoft Edge browser by using MicrosoftWebDriver.

Prerequisites for using MicrosoftWebDriver

Before you start automation with Microsoft Edge browser using Selenium , you need to make sure that –

1. You have windows 10 installed on your machine

2. Download the correct Microsoft WebDriver server version for your OS build.

3. Preferably, use the latest version of Selenium (version 3.0 and above)

Download MicrosoftWebDriver

Follow the steps given below to download Microsoft Edge Driver –

1. The first step is to check the version of your OS build. Based on your OS version build, you have to download the corresponding Edge driver.

2. Go to Start > Settings > System > About. The settings window would be displayed as shown below.

OS Build Version - For MicrosoftWebDriver

3. Note down the number written next to OS Build. This is your build number. In my case its 10586, as shown in the red rectangle in the above image

4. Open Microsoft Edge Webdriver page using this link – https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

5. Scroll down a bit till you see the Downloads section, as shown below

MicrosoftDriverEdge - Release 10586

6. From the list of different versions of Edge drivers, download the one which matches your build number. In this case, I will download Release 10586

7. If you are downloading Release 10240 or 10586, then the file that will be downloaded is MicrosoftWebDriver.msi. You will then need to install this msi file to get the actual MicrosoftWebDriver.exe driver. But if you are downloading Release 14393, then it directly downloads the MicrosoftWebDriver.exe driver. In this case you don’t need to install it.

8. In this scenario we will get the msi file, as we downloaded Release 10586.

9. Install the msi file. Select all default details while installing the msi file. Note down the location where the driver will be installed. This will be displayed in the window shown in the below image

Microsoft WebDriver Setup

10. Once the installation is complete, go to the folder path to check that webdriver is properly installed.

Microsoft Web Driver

This completes the download and installation process. Let us now see how we can use this driver to launch Microsoft Edge.

Launch Microsoft Edge using MicrosoftWebDriver

Just like we did with Firefox & GeckoDriver,there are 2 ways of using MicrosoftWebDriver.

Method 1 : webdriver.edge.driver system property

When you use this method, you will need to just need to add a line of code to your test script to use MicrosoftWebDriver. You will need to add System.setProperty code in your script. The entire script is shown below –

public class MicrosoftEdgeTest {
	
	@Test
	public void MicrosoftEdge_Test1() {
		System.setProperty("webdriver.edge.driver","C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe");
		WebDriver driver = new EdgeDriver();
		driver.get("http://www.google.com");
	}
}

Run this test script. You will see that a new Edge browser is opened and Google.com page is loaded in the web browser. This verifies that the webdriver.edge.driver system property is working fine.

Method 2 : Set property in Environment Variables

1. Copy the entire folder location where MicrosoftWebDriver.exe is saved.

2. Open Advanced tab in System Properties window as shown in below image.

System Properties

3. Open Environment Variables window.

Environment Variables Window

4. In System variables section, select the Path variable (highlighted in red in the above image) and click on Edit button. Then add the location of the webdriver to path variable.

MicrosoftWebDriver in System Path

5. Once the path variable is set, you would not need to set the System property every time in the test script. Your test script would simply look like this –

public class MicrosoftEdgeTest {
	
	@Test
	public void MicrosoftEdge_Test1() {
		WebDriver driver = new EdgeDriver();
		driver.get("http://www.google.com");
	}
}

6. Run the code to check that it works fine. You might need to restart eclipse once, after you set the system variable


This was all about using MicrosoftWebDriver to launch Microsoft Edge browser. Try it out and let us know if you face any issues while implementing this.

We have already written an article on launching Firefox with GeckoDriver. We will be adding many more articles on Selenium in this blog. You can subscribe to our blog to get new articles delivered directly in your inbox.

Filed Under: Selenium

Primary Sidebar

Automation Testing Hub

Tutorials Guide

Write test scripts in BDD format using our Cucumber Selenium Tutorial

Use our Appium Tutorial Series to setup Appium from scratch

Categories

  • Android
  • Appium
  • Cucumber
  • Java
  • Playwright
  • Selenium
  • Tosca

Recent Posts

  • Appium Inspector – Download and Install
  • How to download Chromedriver for Selenium
  • Run Playwright tests on different browsers
  • Playwright Automation Testing Tutorial
  • Selenium IDE Chrome Download

Recent Comments

  • Run Playwright tests on different browsers - AutomationTestingHub on Playwright Automation Testing Tutorial
  • Confluence: CPSSoft Test Framework on Appium Inspector – Download and Install
  • Playwright Automation Testing Tutorial - AutomationTestingHub on Download and Install – Node.js and NPM
  • Chrome浏览器在使用Java的Appium中无法启动。 | JAVA语言的经验与见解 on 2 Ways to find appPackage and appActivity name of your App
  • Appium Inspector Tutorial - AutomationTestingHub on Download and Install Appium 2 Server

Archives

  • January 2024
  • July 2023
  • March 2023
  • February 2023
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016

Latest Selenium 3 Guide

Are you using the latest version of Selenium WebDriver? It provides lot better support for the latest browser versions. Check it out here - Setup Latest Selenium WebDriver

Categories

  • Android
  • Appium
  • Cucumber
  • Java
  • Playwright
  • Selenium
  • Tosca

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in

Go to mobile version