0

저는 거의 일주일 동안 다른 솔루션을 찾고 있었지만 아직 답을 찾지 못했습니다.Chrome 헤드리스 및 Xvfb로 각도기 테스트를 수행 할 수 없습니다.

첫째, 내 환경 : 서버 데비안 8 (비 GUI), 각도기 4.0.9, 셀레늄 서버 2.53.1은 (webdriver-manager를 사용하여 시작), Chromedriver 2.24.417424, 크롬 54.0.2840.100, 파이어 폭스 43.0 , Xvfb

테스트를 실행하기 위해 헤드리스 Chrome을 사용하려고하지만 Chrome을 시작할 수 없습니다. Firefox 헤드리스를 사용하여 테스트를 실행할 수 있습니다. 크롬 사용하여 테스트를 실행하려고이 내 출력 :

[18:38:31] E/launcher - unknown error: Chrome failed to start: crashed 
    (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.16.0-4-amd64 x86_64) (WARNING: The server did not provide any stacktrace information) 
Command duration or timeout: 60.13 seconds 
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03' 
System info: host: 'testing', ip: '10.128.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-4-amd64', java.version: '1.7.0_111' 
Driver info: org.openqa.selenium.chrome.ChromeDriver 
[18:38:31] E/launcher - WebDriverError: unknown error: Chrome failed to start: crashed 
    (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.16.0-4-amd64 x86_64) (WARNING: The server did not provide any stacktrace information) 
Command duration or timeout: 60.13 seconds 
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03' 
System info: host: 'testing', ip: '10.128.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-4-amd64', java.version: '1.7.0_111' 
Driver info: org.openqa.selenium.chrome.ChromeDriver 
    at WebDriverError (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5) 
    at Object.checkLegacyResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15) 
    at parseHttpResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:538:13) 
    at client_.send.then.response (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11) 
    at ManagedPromise.invokeCallback_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14) 
    at TaskQueue.execute_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14) 
    at TaskQueue.executeNext_ (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21) 
    at asyncRun (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25) 
    at /usr/lib/node_modules/protractor/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 (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:329:24) 
    at Builder.build (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:458:24) 
    at Hosted.DriverProvider.getNewDriver (/usr/lib/node_modules/protractor/built/driverProviders/driverProvider.js:37:33) 
    at Runner.createBrowser (/usr/lib/node_modules/protractor/built/runner.js:198:43) 
    at /usr/lib/node_modules/protractor/built/runner.js:277:30 
    at _fulfilled (/usr/lib/node_modules/protractor/node_modules/q/q.js:834:54) 
    at self.promiseDispatch.done (/usr/lib/node_modules/protractor/node_modules/q/q.js:863:30) 
    at Promise.promise.promiseDispatch (/usr/lib/node_modules/protractor/node_modules/q/q.js:796:13) 
    at /usr/lib/node_modules/protractor/node_modules/q/q.js:556:49 
    at runSingle (/usr/lib/node_modules/protractor/node_modules/q/q.js:137:13) 
[18:38:31] E/launcher - Process exited with error code 199 

그것은 항상 동일합니다. 일반적으로 Xvfb를 사용하여 Chrome과 Firefox를 모두 실행할 수 있으며 수동으로 시작하면 chromedriver가 잘 실행됩니다.

Xvfb -ac :99 -screen 0 1280x1024x16 & 
export DISPLAY=:99 

출력 chromedriver 수동으로 시작 :

Starting ChromeDriver 2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3) on port 9515 
Only local connections are allowed. 

너희들이 나를 도울 수 있기를 바랍니다

내가 Xvfb가 시작하는 데 사용하는 명령입니다.

답변

0

명령을 사용하여 각도기 프로세스를 시작해야합니다. xvbf-run protractor configuration.js