Setting up Protractor with Microsoft Edge

pelican picture pelican · Feb 1, 2016 · Viewed 8.9k times · Source

I use CucumberJs and Gulp to run my e2e tests; However, I need to run them against Microsoft Edge. When I do gulp protractor, it successfully opens up both Chrome and Firefox, since neither of them require any drivers like IEDriver.exe or EdgeDriver.exe.

Could anyone point me to an article or show the steps below if it's simple on how to set up Protractor with Microsoft Edge?

I'm trying to achieve parallelism by executing my tests on multiple browsers; this is what my config looks like:

 exports.config = {
  framework: 'cucumber',
  shardTestFiles: true,
  maxInstances: 2,
  multiCapabilities: [
    {
       'browserName': 'MicrosoftEdge',
       'platform': 'windows',
      }
    },
    {
      'browserName': 'firefox',
      loggingPrefs: {
        driver: 'DEBUG',
        server: 'INFO',
        browser: 'ALL'
      }
    }],
    //more configs here
}

I achieved the config right above, to run protractor e2e tests in parallel, using this article: http://blog.yodersolutions.com/run-protractor-tests-in-parallel/

Also one for IE driver would be just as helpful if you don't know how to set up Edge.

UPDATES:

From this link: https://msdn.microsoft.com/en-us/library/mt188085(v=vs.85).aspx; under the

Enabling WebDriver with Microsoft Edge:

Download a WebDriver language binding of your choice. Currently C# and Java Selenium language bindings are supported.

I'm not using Java or C#, I am only using Javascript (Protractor); does that mean that the language binding for Javascript currenlty does NOT work for Edge browser?

In other words, we currently cannot automate the Edge browser using Protractor (Javascript)?

Any help much appreciated and I'll update this post if I find anything pertaining to setting up Protractor with Edge, been looking around the web for hours now.

Answer

Amit Shokeen picture Amit Shokeen · Dec 7, 2017

After some struggle, I got Protractor to work on Microsoft Edge on my Windows 10 system.

Note: I'm using the Jasmine2 framework instead of Cucumber, but I believe the steps below should work for Cucumber as well. I'll try with Cucumber later and update here.

Here are the steps:

  1. Get the Microsoft EdgeHTML version number in use in your system. In my case it is 15.15063. Take a note of the release number here. In this case it is 15063.

    (Q.: How to get the Microsoft EdgeHTML version number?
    A.: Edge browser > ... > Settings > About this app)

  2. download the correct Release of MicrosoftWebDriver.exe from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

    In my case I downloaded Release 15063. If you get the wrong release, then you are likely to run into an error like this error:

    "This version of MicrosoftWebDriver.exe is not compatible with the installed version of Windows 10."

  3. place the MicrosoftWebDriver.exe in the folder where the other drivers are like:

    C:\Users\yourname\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\
    
  4. Adjust your conf.js file. Essentially, this is what conf.js should have:

    seleniumAddress: 'http://localhost:4444/wd/hub',
    capabilities: // or multiCapabilities:
    {
        'browserName': "MicrosoftEdge"
    }
    
  5. start the webdriver-manager like this:

    C:\your\path>webdriver-manager start --edge C:\Users\yourname\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\MicrosoftWebDriver.exe
    
  6. You are all set to run your Protractor tests on the Edge browser.

Good Luck!