Closed mgol closed 8 years ago
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.
Note: The IE11 (32Bit) driver does not display these problems, and works correctly.
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.
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
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
@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
upgrade to selenium-webdriver @ 2.52.0. #2987
upgrade config.json
to selenium server jar @ 2.52.0. #2998
@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 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.
Looks like it might be time to take a look at this again. Microsoft webdriver.
@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.
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/
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 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.
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 fixed but will be available starting from 4.0.0 milestonre right?
do you have already an ETA?
thanks!
@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 @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 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 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 I'm sorry I don't know much about that. My view point is to try and run my tests on MS Edge, and they don't work. I don't use saucelabs as far as I know.
Okay the issue with saucelabs is that they currently do not offer the recent preview version of Edge.
p.s.: the link for tracking the edge capabilities is changed: https://developer.microsoft.com/en-us/microsoft-edge/platform/status/
@evilaliv3 the old link with details (https://developer.microsoft.com/en-us/microsoft-edge/platform/status/webdriver/details/) should now redirect to the documentation with the supported commands.
I'm trying to get MS Edge to run against some Protractor tests I've written on Win 10 using Protractor 4.0.3 and selenium-server 2.53.1.
I followed the above setup and ran
protractor conf_edge.js
based on this example. Edge opens up but then webdriver immediately crashes and I'm getting the following error:
[15:18:58] I/hosted - Using the selenium server at http://localhost:17556
[15:18:58] I/launcher - Running 1 instances of WebDriver
[15:18:59] E/launcher - null
[15:18:59] E/launcher - WebDriverError: null
at WebDriverError (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:27:10)
at Object.checkLegacyResponse (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:639:15)
at parseHttpResponse (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:538:13)
at C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:472:11
at ManagedPromise.invokeCallback_ (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1379:14)
at TaskQueue.execute_ (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2913:14)
at TaskQueue.executeNext_ (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2896:21)
at C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2820:25
at C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7
at process._tickCallback (node.js:369:9)
From: Task: WebDriver.createSession()
at Function.createSession (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:329:24)
at Builder.build (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:458:24)
at Hosted.DriverProvider.getNewDriver (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\driverProvider.js:37:33)
at Runner.createBrowser (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\built\runner.js:187:43)
at C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\built\runner.js:261:30
at _fulfilled (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (C:\Users\joshua.grant\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13)
[15:18:59] E/launcher - Process exited with error code 199
Did you start webdriver-manager
with:
webdriver-manager start --edge
?
You will have to install the edge driver yourself and if the path is different than the default path, you'll need to specify that value on the flag.
@cnishina I tried starting up the webdriver-manager as you suggest and get the same result. I also have the Microsoft WebDriver service running on port 17556.
If you are starting the edge driver yourself, then you should specify the seleniumAddress as http://127.0.0.1:17556. If you do it the way suggested, edge will be started as part of the standalone selenium server.
I've tried both approaches, and neither work.
Using the webdriver-manager start --edge
approach yields an ECONNECT error that Protractor can't connect to Edge properly.
Using the Microsoft Web Driver server started directly, I get the same result as above.
However, as a sanity check I tried connecting to Edge using the Python WebDriver bindings and it yields similar errors even with the configuration suggested. So something fishy is going on here. Likely not a protractor-related problem, so thanks for the help to get this far!
@joshin4colours maybe you are not using the right version of webdriver for your version of edge. https://developer.microsoft.com/microsoft-edge/tools/webdriver/ has links and info of each version.
@molant wow, thanks for that! Fixed the issue and Edge works now as expected. I totally had the wrong version of the MS Web Driver. Thanks so much!
Glad to hear it worked! In the near future we will be checking you are using the right version so this doesn't happen :)
does some of you know how to make it work with travis + saucelabs?
\cc @christian-bromann @pamepros
@evilaliv3 just set proper capabilities. Works with WebdriverIO flawlessly so it should with Protractor:
var browser = require('webdriverio').remote({
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY,
desiredCapabilities: {
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '13.10586'
}
})
browser
.init()
.url('http://webdriver.io')
.getTitle().then(console.log)
.end();
Check out the Platform Configurator to get proper capabilities.
thanks @christian-bromann, i know this.
the issue is that protractor uses a version of edge that is in "preview" status; for this reason all saucelabs users do not have the possibility for now to test the angularjs applications.
i think you should keep this into account in the saucelabs development in order to fill this huge market gap.
@christian-bromann: here you can find the example of the failure applied to the GlobaLeaks project: https://s3.amazonaws.com/archive.travis-ci.org/jobs/159344349/log.txt
@evilaliv3 I just ran a successful test with this config in protractor 2
// conf.js
exports.config = {
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
specs: ['specs/1_spec.js'],
multiCapabilities: [{
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '13.10586'
}]
}
If protractor 4 has issues running edge than it is more likely an issue of protractor 4 not Sauce Labs itself.
@cnishina @sjelin could you please clarify what you think?
It seems that Microsoft update the document: https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/webdriver-commands/
now the async script support has been changed from "preview" to "not supported" and they set a priority 2. :(
Hey @evilaliv3 if you scroll down on that page you'll note that we actually do support execute/execute async. We just don't support the W3C endpoint for execute async (we plan to update this in our next release). The actual functionality though is there and Selenium will support it (JSON Wire Protocol is the older, more established dialect while the W3C spec is currently trying to get to Candidate Review). That page is more so for implementers of language bindings that for end devs to use.
I see. From what stable release? From 14 right?
@evilaliv3 Nope 13 or 10586 has execute async, only 12 was missing it I believe.
POST /session/:sessionId/execute Supported 10240 - 12 POST /session/:sessionId/execute_async Supported 10586 - 13
Thumbs up on the support of MicrosoftEdge v13.10586. Haven't yet been able to get v14.14291 or the latest v21.10540 to work.
Can I kindly ask someone to explain me how I can run a test against MS Edge? What I did so far was just downloading Microsoft Edge webdriver from here and replacing chrome with edge in my protractor.conf as follows:
const config = {
baseUrl: 'https://local.adminportal.com:444/',
specs: [ './dist/**/*.e2e-spec.js' ],
framework: 'jasmine',
directConnect: false,
capabilities: {
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '13.10586'
},
onPrepare: function() {
browser.ignoreSynchronization = false;
},
useAllAngular2AppRoots: true
};
exports.config = config;
Unfortunately, when running my tests, I receive this error:
The path to the driver executable must be set by the webdriver.edge.driver system property;
I found out I have to use the webdriver of MS Edge from here. Then, I should reopen my CLI (cmd, git bash, etc.) :-) However, there're 2 questions left: 1) can I save the webdriver exe file somewhere in my project folder instead of my C:/program files/...? 2) how can I ignore ssl certificates as I currently face with certificate error on my local host and I have to manually proceed the app.
As far as I know webdriver.exe can be anywhere and is specified in your batch file. The certificate of the web-site should be added via keygen to the certs of the java you are using. Check the documentation here: https://docs.oracle.com/javase/tutorial/security/toolsign/rstep2.html
Java should see that this is trusted cert and proceed with the connection. If it is the browser doing this, then it needs to also do the same thing by importing the saved certificate to windows.
Thanks @inthegarage for your explanation. I came up with the cert error using this solution:
if (title.includes('Certificate error')) {
driver.get('javascript:document.getElementById(\'invalidcert_continue\').click()');
}
A new issue I'm struggling with is opening edge in an InPrivate window. Any thoughts?
@smajazayeri The code is fine, but bear in mind all tests from all projects may have to implement this code. If your project set-up is consistent then it maybe worth while replacing the code with some set-up as suggested. It does depend on your own set-up. However I'd avoid decorating all projects with this.
All I can suggest is checking these posts and see if you can use the options contained in them:
Thanks @inthegarage for your advice. However, the link you shared with me doesn't contain any documentation about edge. I also tried to run protractor on IE. The first time it failed with error:
Unexpected error launching Internet Explorer. Unable to use CreateProcess() API. To use CreateProcess() with Internet Explorer 8 or higher, the value of registry setting in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\TabProcGrowth must be '0'.
When I added the required reg key, the error was gone, but the "inPrivate" mode wasn't really "inPrivate". I mean when I manually tried the IE in inPrivate mode, it used my last session!!???
Unable to launch edge driver with protractor. Raised a question as well here. https://stackoverflow.com/questions/47766363/unable-to-launch-microsoft-edge-with-protractor Could anyone please help here.
Microsoft published edgedriver - a driver for the Microsoft Edge browser. Protractor should support it as it supports Internet Explorer.