As you may or may not be aware, Edge is moving away from the EdgeHTML and Chakra engines and over to Chromium.  Unfortunately getting your test code to work with the new Chromium Edge browser isn’t as easy as updating your web driver.

Getting started

Before you make any change to your code you should install Chromium Edge, which can be installed side by side with the old version of Edge.  You will also need to get the corresponding web driver.

To make life easier I’ve pulled together the initial setup into the following steps:

  1. Install the new Chromium based Edge browser from
    https://www.microsoftedgeinsider.com/en-us/
  2. Note what version of Chromium Edge was installed
Getting to about
About
  1. Download and unzip the corresponding web driver from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Download version

Required Code Changes

For the most part you will not need to change any of your test code in order to work with Chromium Edge.  The only change you will need to make is in the initialization of your web driver.  The current Edge web driver cannot connect to the new browser or driver without some work.  Below I have outlined what you need to do in order to use this new browser with Selenium 3 or with the Selenium 4 Alpha.

Selenium 3

In Selenium 3 the easiest and arguably cleanest way to run Chromium Edge is to just use the Chrome driver and driver classes. This however requires one biggish hack; you will need to rename the Edge driver which you downloaded earlier.  You need to change the driver name from "msedgedriver.exe" to "chromedriver.exe".

Sample code:

ChromeOptions chromeOptions = new ChromeOptions()
{
    // Your version of Edge may be installed in another location
    BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge Beta\Application\msedge.exe"
};

return new ChromeDriver(@"C:\WHEREVER_YOU_UNZIPPED\edgedriver_win64", chromeOptions);

Selenium 4

Things get a little cleaner and more straight forward with the latest Selenium 4.0.0-alpha03 release. Now you can use the Edge classes and you don’t need to rename anything.  Selenium 4 is in Alpha, so users beware. You will also need to pass in "false" to the EdgeOptions constructor and CreateDefaultService function.  Passing "false" into these calls let’s Selenium know that you are using the new Chromium instead of the old EdgeHTML version of Edge.

Sample code (where provide the Edge driver download location):

EdgeOptions edgeOptions = new EdgeOptions(false)
{
    BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge Beta\Application\msedge.exe",
};

return new EdgeDriver(EdgeDriverService.CreateDefaultService(@"C:\WHEREVER_YOU_UNZIPPED\edgedriver_win64", false), edgeOptions);

Sample code (where you copy the Edge driver to your test dll location):

EdgeOptions = new EdgeOptions(false)
{
    BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge Beta\Application\msedge.exe",
};

return new EdgeDriver(EdgeDriverService.CreateDefaultService(false), edgeOptions); 

Observations

Overall the new Chromium Edge is a big improvement.  It is pretty much just like testing Chrome.

What I like

  1. Tests run very fast
  2. Can now run headless
  3. Can run in parallel
  4. No more worrying about IE security zones
  5. You can once again download the web driver – AKA don’t need to enable a windows feature

What I don’t like

  1. Needing to tell both the EdgeOptions and CreateDefaultService calls that I am using the newer version of Edge