내 protractor 프로그램을 Jenkins에서 실행하려고하지만 Jenkins에는 디스플레이가 없으므로 헤드리스 모드로 크롬을 실행해야합니다. chrome이 헤드리스 모드를 가지고 있지 않기 때문에, 나는 xvfb를 사용하여 디스플레이을 모방 해야합니다.Xvfb를 사용하여 젠킨스에서 크롬으로 헤드리스 각도기를 작동시키는 방법은 무엇입니까?
나는 자습서를 따라 왔지만 각도기를 실행할 때 크롬이 충돌합니다. 여기
내가 가진 무엇 : - :+ echo Starting xvfb on :99...
Starting xvfb on :99...
+ export DISPLAY=:99
+ echo Checking that xvfb started ok...
Checking that xvfb started ok...
+ xdpyinfo -display :99
+ Xvfb -ac :99 -screen 0 1280x1024x16
+ echo xvfb is using :99
xvfb is using :99
[22:26:25] I/local - Starting selenium standalone server...
[22:26:25] I/launcher - Running 1 instances of WebDriver
[22:26:26] I/local - Selenium standalone server started at http://10.0.0.82:54385/wd/hub
[22:27:26] E/launcher - unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 4.4.0-47-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.16 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'ip-10-0-0-82', ip: '10.0.0.82', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-47-generic', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
[22:27:26] E/launcher - WebDriverError: unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 4.4.0-47-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.16 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'ip-10-0-0-82', ip: '10.0.0.82', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-47-generic', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at WebDriverError (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/lib/error.js:27:5)
at Object.checkLegacyResponse (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/lib/error.js:639:15)
at parseHttpResponse (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/http/index.js:538:13)
at client_.send.then.response (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/http/index.js:472:11)
at ManagedPromise.invokeCallback_ (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at asyncRun (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/lib/promise.js:2820:25)
at /jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
at Function.createSession (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
at Builder.build (/jenkins/workspace/myjob/src/js/node_modules/selenium-webdriver/builder.js:458:24)
at Local.DriverProvider.getNewDriver (/jenkins/workspace/myjob/src/js/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
at Runner.createBrowser (/jenkins/workspace/myjob/src/js/node_modules/protractor/built/runner.js:198:43)
at /jenkins/workspace/myjob/src/js/node_modules/protractor/built/runner.js:277:30
at _fulfilled (/jenkins/workspace/myjob/src/js/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/jenkins/workspace/myjob/src/js/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/jenkins/workspace/myjob/src/js/node_modules/q/q.js:796:13)
at /jenkins/workspace/myjob/src/js/node_modules/q/q.js:604:44
at runSingle (/jenkins/workspace/myjob/src/js/node_modules/q/q.js:137:13)
[22:27:26] E/launcher - Process exited with error code 199
내가 Chrome failed to start: crashed
가 계속
빌드 (젠킨스 작업에서) 셸을 실행을
#emulate display
echo "Starting xvfb on :99..."
Xvfb -ac :99 -screen 0 1280x1024x16 &
export DISPLAY=:99
echo "Checking that xvfb started ok..."
xdpyinfo -display :99 >/dev/null 2>&1 && echo "xvfb is using :99" || echo "xvfb is not using :99, it's free."
#now start my program
xvfb-run -a --server-args='-screen 0, 1024x768x16' protractor conf.js
그리고 여기 내 출력입니다 모든 항목 나는 시도했다 ... xvfb를 시작하거나 설정하는 방법에 문제가 있는가? 아니면 각도기 코드에 문제가 있습니까? stacktrace가 전혀 도움이되지 않습니다 x.x
다음을보십시오 : https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start –
나는 그 오류가 크롬이 어딘가에서 열려고한다는 것을 확신합니다. 'DISPLAY = : 99'가 아닙니다. 과거에는'webdriver manager start'를 실행하는'export DISPLAY = : 99'를해야했습니다. 직접 연결을 사용하는 경우 해당 환경 변수로 데몬으로 chrome을 시작해야 할 것입니다. – mvndaai
감사합니다. @mvndaai! 나는 그것을 시도 할 것이다. – Kayvar