首页 > 解决方案 > Jenkins 中的 Selenium 作业配置错误

问题描述

我只是在我的 Jenkins 中集成 Protractor 端到端测试工作。Jenkins 在 CentOS 7 上运行。在我的一位测试工程师的帮助下,创建了一个 config.js 文件并为此创建了一个 Jenkins 作业。

执行此作业时,我在 Jenkins 控制台中收到以下错误:

+ cd '/var/lib/jenkins/workspace/UI Automation Test/UI-automation-tests/Test/steps'
+ protractor config.js
(node:11138) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[07:12:43] I/launcher - Running 1 instances of WebDriver
[07:12:43] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[07:12:43] W/launcher - Ignoring uncaught error WebDriverError: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.44.609551 (5d576e9a44fe4c5b6a07e568f1ebc753f1214634),platform=Linux 3.10.0-862.2.3.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)

标签: jenkinsprotractor

解决方案


这是 ChromeDriver 的错误(已报告)。对于 Linux 系统,您可以使用此参数来避免此错误:

--disable-dev-shm-usage

推荐阅读