最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to configure Protractor (JS) for running tests in Microsoft Edge? - Stack Overflow

programmeradmin1浏览0评论

I want to set my protractor.conf.js to run tests in Edge instead of in Chrome. Setting this

capabilities: {
    'browserName': 'MicrosoftEdge'
}

results in SessionNotCreatedError: Unable to create new service: EdgeDriverService with an error code of 199. I downloaded the MicrosoftWebDriver.exe for the version of Edge that I have from Microsoft's website, but I can't figure out how to tell Protractor where to find that driver. I've tried adding it to my user path, my system path, the selenium folder in protractor's node modules folder, and giving a jvmArgs: or seleniumArgs: of ['-Dwebdriver.edge.driver="<path-to-driver"'], but I still get that SessionNotCreatedError.

I'm only writing pure JavaScript, no Java or C#, and I want all of this to be set as attributes in the protractor.conf.js file, nothing set in the actual file of tests. I have the most recent version of Node, and I'm making sure to have Edge closed when running ng e2e. What do I need to change or add to my config file to get this to run?

EDIT: From this github issue, I added seleniumAddress: http://127.0.01:17556/ to my config file, but now I'm getting an ECONNREFUSED 127.0.0.1:17556 error with error code 135. I got that address from one of the ments on that github issue, but I get the same error regardless of starting the Edge driver manually or just running ng e2e --config <path-to-config>.


SOLUTION
Add seleniumAddress: 'http://localhost:4444/wd/hub' to the config file. Run the edge driver manually with webdriver-manager start --edge "<path-to-driver>\MicrosoftWebDriver.exe", and then run ng e2e in another window. Thank you so much to HaC for this solution!

I want to set my protractor.conf.js to run tests in Edge instead of in Chrome. Setting this

capabilities: {
    'browserName': 'MicrosoftEdge'
}

results in SessionNotCreatedError: Unable to create new service: EdgeDriverService with an error code of 199. I downloaded the MicrosoftWebDriver.exe for the version of Edge that I have from Microsoft's website, but I can't figure out how to tell Protractor where to find that driver. I've tried adding it to my user path, my system path, the selenium folder in protractor's node modules folder, and giving a jvmArgs: or seleniumArgs: of ['-Dwebdriver.edge.driver="<path-to-driver"'], but I still get that SessionNotCreatedError.

I'm only writing pure JavaScript, no Java or C#, and I want all of this to be set as attributes in the protractor.conf.js file, nothing set in the actual file of tests. I have the most recent version of Node, and I'm making sure to have Edge closed when running ng e2e. What do I need to change or add to my config file to get this to run?

EDIT: From this github issue, I added seleniumAddress: http://127.0.01:17556/ to my config file, but now I'm getting an ECONNREFUSED 127.0.0.1:17556 error with error code 135. I got that address from one of the ments on that github issue, but I get the same error regardless of starting the Edge driver manually or just running ng e2e --config <path-to-config>.


SOLUTION
Add seleniumAddress: 'http://localhost:4444/wd/hub' to the config file. Run the edge driver manually with webdriver-manager start --edge "<path-to-driver>\MicrosoftWebDriver.exe", and then run ng e2e in another window. Thank you so much to HaC for this solution!

Share Improve this question edited Dec 21, 2017 at 16:15 Emily asked Dec 19, 2017 at 16:57 EmilyEmily 1361 gold badge3 silver badges15 bronze badges 3
  • 1 Try to launch the driver directly via mand line to see if the issue is related to the driver or your environment. – Florent B. Commented Dec 19, 2017 at 17:38
  • Duplicate of stackoverflow./questions/47766363/… – tyaga001 Commented Dec 20, 2017 at 5:55
  • I did find that question in my initial research, but that question doesn't have a solution. – Emily Commented Dec 20, 2017 at 14:39
Add a ment  | 

1 Answer 1

Reset to default 7

Reference : https://github./angular/protractor/issues/2377

  1. Download and install Edge driver
  2. Run webdriver-manager start --edge "C:\path_to_the_driver\MicrosoftWebDriver.exe" . By default this will start your selenium server on port 4444 which should be open to you.
  3. In your protractor config file: add seleniumAddress: 'http://localhost:4444/wd/hub'
发布评论

评论列表(0)

  1. 暂无评论