protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Officially support Microsoft Edge

Open mgol opened this issue 11 years ago • 53 comments

Microsoft published edgedriver - a driver for the Microsoft Edge browser. Protractor should support it as it supports Internet Explorer.

mgol avatar Jul 27 '15 13:07 mgol

Edge kind of works now, however there are some problems. I am not sure if it is that the Microsoft Webdriver is just not fully compatible with Webdriver Specs yet, or there are hiccups in the Protractor implementation with the Microsoft Driver.

Currently I do the following to get the edge server to work with protractor.

  • Download the driver.
  • Install it into the default location. C://Program Files(x86)/MicrosoftWebdriver
  • Click on the installed file to start running the Edge Server .
  • An address is provided by the Edge server, and I then add the address as a selenium address in protractor config file.
  • Afterwards, protractor connects to the Edge server and is able to run the tests. (just make sure Edge browser is closed before starting a session)

##Anyways, with respect to Edge, I am running into the following problems.

  1. manage.windows actions are causing the edge browser to crash. browser.driver.manage().window().maximize(); Error : "Unknown command received"
  2. Action sequences are not working with the edge driver. browser.actions().mouseMove(element(by.css("#whyyounoworky"))).perform(); Error : "Unknown command received" (This problem makes Edge unusable for me. Since I have lots of hovering to do)

Note: The IE11 (32Bit) driver does not display these problems, and works correctly.

jpoints avatar Aug 17 '15 04:08 jpoints

I am also getting some issue in Microsoft Edge, such as multiple driver is not working. when second browser is open it overrides the first one.

public static void main(String args[]) throws InterruptedException, AWTException { OpenBrowser2 op=new OpenBrowser2(); op.openBrowser(); op.openBrowser(); op.openBrowser(); op.openBrowser(); } public void openBrowser() { System.setProperty("webdriver.edge.driver", "C:/Program Files (x86)/Microsoft Web Driver/MicrosoftWebDriver.exe"); driver= new EdgeDriver(); driver.get("www.google.com"); }

Also getting Unknown Command Received when trying to maximize window.

TARIFABBAS avatar Aug 20 '15 10:08 TARIFABBAS

Hi jpoints,

I am trying to use protractor to run my tests on Microsoft Edge, and I followed the steps you mentioned above. However, what I am seeing is that MS edge is open and address bar shows the url (the baseUrl in protractor.conf.js), then it hangs there, the page is not rendered/displayed.

Eventually, I get an error message saying Error while running testForAngular: not implemented.

Anything you can help? Thanks in advance. Kai

shaokaichris avatar Oct 20 '15 22:10 shaokaichris

i'm getting the same error of @shaokaichris on the GlobaLaks project.

here you find some debugging info: https://travis-ci.org/globaleaks/GlobaLeaks/jobs/86801624

evilaliv3 avatar Oct 22 '15 11:10 evilaliv3

@juliemr i think that on this front there are good news. the selenium-webdriver changelog for 2.52.0 mentions explicitly:

Add support for Microsoft's Edge web browser

p.s.: take care that i've notifce that in various project files i've noted that it's still defined the use of selenium-webdriver 2.48.2; maybe is now better to align it all to the 2.52.0? e.g. in the https://github.com/angular/protractor/blob/3d12d894ba1bcc97c51339ee5ce87c26d8e5ceed/package.json

\cc @sjelin

evilaliv3 avatar Feb 13 '16 17:02 evilaliv3

upgrade to selenium-webdriver @ 2.52.0. #2987

cnishina avatar Mar 02 '16 01:03 cnishina

upgrade config.json to selenium server jar @ 2.52.0. #2998

cnishina avatar Mar 09 '16 08:03 cnishina

@cnishina could you please clarify which is the status for this and if making it work with edge is now simply a matter of configuring it well?

evilaliv3 avatar Mar 16 '16 01:03 evilaliv3

@evilaliv3 Protractor relies on exec async script and the Microsoft Edge Driver shows the status of this as still in preview. This investigation is tracked on #3016.

cnishina avatar Mar 16 '16 06:03 cnishina

Looks like it might be time to take a look at this again. Microsoft webdriver.

cnishina avatar Jun 08 '16 21:06 cnishina

@cnishina the list of all the commands and in what version they have been implemented is available here. @instylevii can probably help or give more information if needed.

molant avatar Jun 09 '16 02:06 molant

Hey @cnishina we actually do support execute script/execute script async and have since build 10586 (our fall update). I've been updating all of our documentation pages and they should reflect this now. Note that we support the JSON Wire Protocol endpoint and not the W3C spec endpoint (yet) for both (JSON Wire Protocol is further down the page). You can check out all of our commands supported here: https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/webdriver-commands/

Also for downloads you can get our relevant version here: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

instylevii avatar Jun 16 '16 23:06 instylevii

Hi @InstyleVII thanks for the further info! Our issue is specifically that we need execute async script to work, which is still listed as unsupported under "Webdriver spec support", but supported under "JSON Wire Protocol support". Could you clarify? (EDIT: what I meant to ask is, could you clarify what supporting the JSON protocol but not W3C spec means?)

juliemr avatar Jun 17 '16 04:06 juliemr

@juliemr The language bindings via Selenium will be able to use execute async as well. We support the implementation just not the W3C specs endpoint (/session/{session id}/execute/async) on our server. We'll be updating it to add that endpoint in the future. So just to be clear both execute script and execute async script work in our webdriver implementation (and have since our fall update 10586). If you run into issues though feel free to ping me on here or on twitter @instylevii.

instylevii avatar Jun 18 '16 22:06 instylevii

This appears to be working now with release 10586 (version 2.10586). Example here:

https://github.com/cnishina/protractor-examples/tree/master/protractor/edge_spec

Also, added webdriver-manager support for edge: https://github.com/angular/webdriver-manager/pull/56

cnishina avatar Jun 28 '16 00:06 cnishina

@cnishina fixed but will be available starting from 4.0.0 milestonre right?

do you have already an ETA?

thanks!

evilaliv3 avatar Jun 28 '16 10:06 evilaliv3

@evilaliv3 Yes... 4.0.0 milestone. ETA = soon (maybe the end of the month?). webdriver-manager has support for Edge but you still need to download the binaries.

cnishina avatar Jun 28 '16 22:06 cnishina

@cnishina @juliemr

could you please clarify if the user has still to download the edge webdriver manually and if yes how is the process for using it with protractor?

i think it would be important to improve documentation around this topic.

i've tried with saucelabs but i'm getting this error: Error while waiting for Protractor to sync with the page: "[ng:test] http://errors.angularjs.org/1.5.7/ng/test"

https://s3.amazonaws.com/archive.travis-ci.org/jobs/145769678/log.txt

thanks as usual!

evilaliv3 avatar Jul 19 '16 09:07 evilaliv3

@evilaliv3 Yes you must still download the edge driver manually and I have batch file that runs it manually also.

java -jar "C:\Users\<your user>\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-2.53.1.jar" -Dwebdriver.gecko.driver=C:\tools\gecko\geckodriver.exe -Dwebdriver.firefox.bin="C:\Program Files\Nightly\firefox.exe" -Dwebdriver.edge.driver="C:\tools\gecko\MicrosoftWebDriver.exe"

Ensure the driver is version 2, version 1 simply does not work. You can strip the marionette (FF 48+) stuff out if you wish.

Then in your protractor conf file do the following:

        baseUrl: 'http://127.0.0.1:4321/index_protractor.html',
        capabilities: {
            'browserName': 'MicrosoftEdge',
            elementScrollBehavior: 1,
            nativeEvents: false
        }

_You need to refer to the baseURL in your test file:

beforeAll(function() {
    browser.get(browser.baseUrl);_

The above in italics, no longer seems to be needed.

That bit is code clutter and sucky. Can this be improved please?

And you will also need to use the very latest protractor 4.0.0+

inthegarage avatar Aug 02 '16 12:08 inthegarage

@inthegarage i'm using travis + saucelabs where i expect the selenium/edge webdriver to be updated but the test is still not working: https://s3.amazonaws.com/archive.travis-ci.org/jobs/150395376/log.txt


Failures:
1) globaLeaks setup wizard should allow the user to setup the wizard
  Message: Failed: Error while waiting for Protractor to sync with the page: "[ng:test] http://errors.angularjs.org/1.5.8/ng/test"

The same tests are instead working perfectly on internet explorer 11: https://travis-ci.org/globaleaks/GlobaLeaks

do you know if there is any incompatibility with saucelabs?

evilaliv3 avatar Aug 07 '16 18:08 evilaliv3