从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
Chromimum窗口在这里打开.
我使用Debian的杰西(测试)与安装chromimum和chromedriver 资质.这是为了获得同类版本.
$ google-chrome -version Chromium 33.0.1750.152 Debian jessie/sid
./chromedriver -v Starting ChromeDriver (v2.8.undefined) on port 9515
我还使用以前版本的Debian创建了另一个问题,您可以阅读以了解我之前尝试过的更多内容.未知错误:Chrome无法启动:异常退出(驱动程序信息:chromedriver = 2.9