未知错误:Chrome无法启动:异常退出(驱动程序信息:chromedriver = 2.8.undefined

问题描述 投票:7回答:1

从jenkins运行selenium测试时,我收到此错误:

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.8.undefined,platform=Linux 3.13-1-686-pae x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 20.54 seconds
Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.13-1-686-pae', java.version: '1.6.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver

并进一步在堆栈跟踪中:

DEBUG - Sending request: POST /session HTTP/1.1
DEBUG - >> "POST /session HTTP/1.1[\r][\n]"
DEBUG - >> "Accept: application/json, image/png[\r][\n]"
DEBUG - >> "Content-Type: application/json; charset=utf-8[\r][\n]"
DEBUG - >> "Content-Length: 143[\r][\n]"
DEBUG - >> "Host: localhost:30992[\r][\n]"
DEBUG - >> "Connection: Keep-Alive[\r][\n]"
DEBUG - >> "[\r][\n]"
DEBUG - >> POST /session HTTP/1.1
DEBUG - >> Accept: application/json, image/png
DEBUG - >> Content-Type: application/json; charset=utf-8
DEBUG - >> Content-Length: 143
DEBUG - >> Host: localhost:30992
DEBUG - >> Connection: Keep-Alive
DEBUG - >> "{"desiredCapabilities":{"platform":"ANY","browserName":"chrome","chromeOptions":{"args":[],"extensions":[]},"version":"","chrome.switches":[]}}"
DEBUG - << "HTTP/1.1 200 OK[\r][\n]"
DEBUG - << "Content-Length:218[\r][\n]"
DEBUG - << "Content-Type:application/json; charset=utf-8[\r][\n]"
DEBUG - << "Connection:close[\r][\n]"
DEBUG - << "[\r][\n]"
DEBUG - Receiving response: HTTP/1.1 200 OK
DEBUG - << HTTP/1.1 200 OK
DEBUG - << Content-Length:218
DEBUG - << Content-Type:application/json; charset=utf-8
DEBUG - << Connection:close
DEBUG - << "{"sessionId":"a272d037ff7f0bff2cfb2a49e052c02a","status":13,"value":{"message":"unknown error: Chrome failed to start: exited abnormally\n (Driver info: chromedriver=2.8.undefined,platform=Linux 3.13-1-686-pae x86)"}}"
DEBUG - Connection shut down

我没有使用硒网格。

奇怪的是,我可以直接向chromedriver发送命令时启动chrome,如下面的命令所示:

curl -X POST -H "Content-Type: application/json; charset=utf-8" -d "{\"desiredCapabilities\":{\"platform\":\"ANY\",\"browserName\":\"chrome\",\"chromeOptions\":{\"args\":[],\"extensions\":[]},\"version\":\"\",\"chrome.switches\":[]}}" localhost:9515/session

Chromium窗口在这里打开。

我正在使用Debian jessie(测试)与chrome和chromedriver安装aptitude。这是为了获得同类版本。

$ google-chrome  -version
Chromium 33.0.1750.152 Debian jessie/sid
./chromedriver -v
Starting ChromeDriver (v2.8.undefined) on port 9515

我还使用以前版本的Debian创建了另一个问题,您可以阅读以了解我之前尝试过的更多内容。 unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9

google-chrome selenium jenkins hudson selenium-chromedriver
1个回答
0
投票

至少在linux机器上,我认为chrome需要一个X11显示才能启动。您可以将其作为常规显示(当您在桌面环境中以普通用户身份运行时),通过网络连接到普通远程或本地显示(例如通过vnc server)或通过虚拟设备(如X虚拟帧缓冲) 。

为了您的目的(测试)我会说Xvfb可能是最好的选择。有关使用它进行测试的示例,请参阅here

© www.soinside.com 2019 - 2024. All rights reserved.