SessionNotCreatedError:无法创建新服务:ChromeDriverService [英] SessionNotCreatedError: Unable to create new service: ChromeDriverService

查看:46
本文介绍了SessionNotCreatedError:无法创建新服务:ChromeDriverService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有 AngularJS 量角器测试.该过程是按顺序设置和运行这些步骤:

We have AngularJS protractor tests. The process is to set up and run these steps in order:

$ npm install
$ webdriver-manager update --ie32 --ignore_ssl
$ gulp

我遇到的问题是此设置适用于我团队中的其他人,但 100% 的情况下我都会收到此错误:

The problem I'm having is this setup works for everyone else on my team but 100% of the time I receive this error:

[11:42:33] I/local - Starting selenium standalone server...
[11:42:36] I/local - Selenium standalone server started at http://10.222.189.129:55574/wd/hub

/path/to/repo/node_modules/selenium-webdriver/lib/error.js:27
    super(opt_error);
    ^
SessionNotCreatedError: Unable to create new service: ChromeDriverService
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z'
System info: host: 'xxxx', ip: 'xxxx', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_131'
Driver info: driver.version: unknown
   at WebDriverError (/path/to/repo/node_modules/selenium-webdriver/lib/error.js:27:5)
   at SessionNotCreatedError (/path/to/repo/node_modules/selenium-webdriver/lib/error.js:214:5)
   at Object.checkLegacyResponse (/path/to/repo/node_modules/selenium-webdriver/lib/error.js:505:15)
   at parseHttpResponse (/path/to/repo/node_modules/selenium-webdriver/lib/http.js:509:13)
   at doSend.then.response (/path/to/repo/node_modules/selenium-webdriver/lib/http.js:440:13)
   at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
   at Function.createSession (/path/to/repo/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
   at Function.createSession (/path/to/repo/node_modules/selenium-webdriver/chrome.js:709:29)

这个问题与我的设置有关,但我不知所措,所以向这样的人致敬,希望有人有任何建议.

The problem is something to do with my setup but I'm at a loss, so throwing a Hail Mary on SO hoping anyone has any advice.

如果您需要任何其他信息,请告诉我.预先感谢您,我已经浪费了很多时间来尝试让它工作!

Please let me know if you need any additional info. Thank you in advance, I've wasted a lot of time trying to get this to work!

推荐答案

这可以通过更新到 chromedriver 和 chrome 的最新版本来解决.

This can be fixed by updating to the latest version of both chromedriver and chrome.

如果您使用的是 webdriver-manager,请运行

If you are using webdriver-manager, run

webdriver-manager update --chromedriver

然后从 https://www.google.com/chrome/browser/desktop 下载 Chrome/ 并用最新版本替换旧的 chrome.

Then download Chrome from https://www.google.com/chrome/browser/desktop/ and replace your old chrome with the latest version.

您还需要在运行 webdriver 的终端中 Ctrl-C 并运行

You will also need to Ctrl-C in the terminal where webdriver is running and run

webdriver-manager start

或者杀死并重新启动 Selenium 守护进程以捕获最新的 chromedriver.重新启动系统可能会有所帮助.

Or kill and restart the Selenium daemon process to capture the latest chromedriver. A system restart might be helpful.

也值得一试:

npm update -g protractor
webdriver-manager update

另请参阅会话未为量角器中的 chrome 创建异常 有关如何在量角器的配置中修改 Chromedriver 版本的更多详细信息

Also see session not created exception for chrome in Protractor for more details on how to modify the version of Chromedriver in protractor's config

最后,确保你的 protractor.conf.js 有

Lastly, make sure that your protractor.conf.js has

   commonCapabilities: {
     'browserName': 'chrome',
   },

否则你应该使用

--browser chrome

量角器命令上的标志

这篇关于SessionNotCreatedError:无法创建新服务:ChromeDriverService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆