# Running your Selenium checks on Microsoft Edge

For the last week or so, after spending some time upgrading some of our existing selenium client machines I thought it would be a good idea to find out more about Selenium checks (tests…) on Microsoft’s new browser, Edge.

It’s the first time that Microsoft have released a web driver themselves, officially supporting it.

Below are some of the issues I’ve found whilst using it, and since I had to spend some time digging around GitHub/Google I thought I’d collate them here.

The first problem I found was trying out the example given by Microsoft themselves on their blog (https://blogs.windows.com/msedgedev/2015/07/23/bringing-automated-testing-to-microsoft-edge-through-webdriver/)

The first thing you do is install the web driver (link is in the url above).

Then all of a sudden, without modifying the code posted by Microsoft, the tests would just hang. Upon inspecting the output I could see that:

“Existing Microsoft Edge (pid: xxx) terminated forcibly”

In this case, the problem was with Edge itself. By default, Edge has a startup page rather than a url, and it appears that the web driver struggled to understand that, quitting straight away. Simply go to Edge’s options and change this to a url you want (Google or Bing should do just fine).

The next problem I faced when I tried to run those checks was that Edge couldn’t be launched if the user was builtin\Administrator. This is a security issue implemented in Windows 10 and to work around it have a look here: https://4sysops.com/archives/why-the-built-in-administrator-account-cant-open-edge-and-a-lesson-in-uac/ (hint: the solution is actually only described half way down the page).

To add Edge as a browser that can be run on a selenium grid, edit the node’s configuration file by adding the following (and changing as you wish):

{
"browserName": "MicrosoftEdge",
"maxInstances": 4,
"platform" : "WINDOWS"
}


Next issue was that Selenium couldn’t detect the Edge web driver. One workaround is to move the place where the installer places the web driver to where you running your Selenium node from (i.e. the same folder). After that, add this to your node startup file (where you also tell it where Selenium lives for example):

-Dwebdriver.edge.driver=.\MicrosoftWebDriver.exe


This should allow you to run your checks using remote capabilities, and here’s how I’ve done it:

var capabilities = new DesiredCapabilities("internet explorer", "11", new Platform(PlatformType.Windows))
var edgeProfile = new EdgeOptions();