I’m working on a project to begin Node/Angular applications using and Jasmine. I have a POC working in most browsers but having a lot of trouble with MS . Here’s my environment:

OS: Windows 10 Pro (Version 1709, OS Build 16299.98)
MS Edge: 41.16299.15.0
MS EdgeHTML: 16.16299
MS Web Driver: 10.0.16299.15
Node: 6.12.0
Protractor: 5.2.1
Jasmine: 2.8.0
Selenium: 3.8.1

When I the in Chrome and Firefox the behavior is fine ( with expected results). However, with MS Edge the process fails before the test spec can even .

Example code/output use the Protractor tutorial but I have the same issue when working with our application.

Working conf.js (for Chrome and Firefox)

exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['./spec/spec.js'],

  multiCapabilities: [
    { 'browserName': 'chrome' },
    { 'browserName': 'firefox', 'marionette': true, 'firefox_binary': "C:\Program Files\Mozilla Firefox\firefox.exe" }//,
]  
}

Failing conf.js (for MS Edge)

exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:17556',
  specs: ['./spec/spec.js'],

  capabilites: { browserName: 'MicrosoftEdge' }
}

spec.js

// spec.js
describe('Protractor Demo App', function() {
  it('should have a title', function() {
    browser.get('http://juliemr.github.io/protractor-demo/');

    expect(browser.getTitle()).toEqual('Super Calculator');
  });
});

When I run the test for MS Edge after starting the Web Driver the following occurs:

$ protractor conf.js
[14:14:18] I/launcher - Running 1 instances of WebDriver
[14:14:18] I/hosted - Using the selenium server at http://localhost:17556
[14:14:20] E/launcher - Error code: 135
[14:14:20] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:17556
[14:14:20] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:17556
    at ClientRequest.<anonymous> (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverhttpindex.js:238:15)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:310:9)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1281:8)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
From: Task: WebDriver.createSession()
    at Function.createSession (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverlibwebdriver.js:769:24)
    at Function.createSession (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverchrome.js:761:15)
    at createDriver (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverindex.js:170:33)
    at Builder.build (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverindex.js:626:16)
    at Hosted.getNewDriver (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractorbuiltdriverProvidersdriverProvider.js:53:33)
    at Runner.createBrowser (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractorbuiltrunner.js:195:43)
    at q.then.then (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractorbuiltrunner.js:339:29)
    at _fulfilled (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesqq.js:834:54)
    at self.promiseDispatch.done (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesqq.js:863:30)
    at Promise.promise.promiseDispatch (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesqq.js:796:13)
[14:14:20] E/launcher - Process exited with error code 135

The problem seems to be somewhere around that it says it is using the server on ‘localhost’ but then makes requests on ‘127.0.0.1’ instead.

I’ve been looking around a long time (here, StackOverflow, and, the Protactor discussions on GitHub) for info on this but have not found a resolution. Some discussion on GitHub indicates MS Edge testing with Protractor was working at one point. Has anyone been able to successfully run Protractor tests with this version of MS Edge and MS Webdriver?

One final bit of info: I have access to another Windows 10 machine that has an older version of Edge (10240). On that machine I don’t have this problem, but, it is old enough to still have issues with async and I’m not able to use it for testing with Protractor.

Thanks!

UPDATE

The spec file has not changed but I have updated the config file (conf.js):

// conf.js
exports.config = {
    directConnect: false,
    framework: 'jasmine',
    specs: ['./spec/spec.js'],
    seleniumAddress: 'http://localhost:4444/wd/hub',

    multiCapabilities: [
        //{ 'browserName': 'chrome' },
        //{ 'browserName': 'firefox', 'marionette': true, 'firefox_binary': "C:\Program Files\Mozilla Firefox\firefox.exe" },
        { 'browserName': 'MicrosoftEdge' }
    ]
};

When enabled Chrome and Firefox are able to run the test.

Edge fails with the following (timeout waiting for driver server to start):

$ protractor conf.js
[13:13:53] I/launcher - Running 1 instances of WebDriver
[13:13:53] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[13:14:13] E/launcher - Timed out waiting for driver server to start.
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: 'QA-01', ip: '10.1.1.80', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '9.0.1'
Driver info: driver.version: unknown
[13:14:13] E/launcher - WebDriverError: Timed out waiting for driver server to start.
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: 'QA-01', ip: '10.1.1.80', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '9.0.1'
Driver info: driver.version: unknown
    at WebDriverError (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverliberror.js:27:5)
    at Object.checkLegacyResponse (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverliberror.js:546:15)
    at parseHttpResponse (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverlibhttp.js:509:13)
    at doSend.then.response (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverlibhttp.js:441:30)
    at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
    at Function.createSession (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverlibwebdriver.js:769:24)
    at createDriver (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverindex.js:170:33)
    at Builder.build (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesselenium-webdriverindex.js:635:14)
    at Hosted.getNewDriver (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractorbuiltdriverProvidersdriverProvider.js:53:33)
    at Runner.createBrowser (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractorbuiltrunner.js:195:43)
    at q.then.then (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractorbuiltrunner.js:339:29)
    at _fulfilled (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesqq.js:834:54)
    at self.promiseDispatch.done (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesqq.js:863:30)
    at Promise.promise.promiseDispatch (C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesqq.js:796:13)
    at C:UsersUSER.NAMEAppDataRoamingnpmnode_modulesprotractornode_modulesqq.js:556:49
[13:14:13] E/launcher - Process exited with error code 199

As before – the same setup on an older version of Windows 10, Edge (10240), and, the Edge Driver do try to run the tests (albeit with the async execution issue).

This setup is probably better than what I used before but the overall outcome is the same. Protractor tests (on this machine) aren’t running in MS Edge (16299).

Any insight or advice is much appreciated.

Thanks!



Source link https://sqa.stackexchange.com/questions/30830/-to-run-protractor-tests-in-microsoft-edge

LEAVE A REPLY

Please enter your comment!
Please enter your name here