量角器:如何捕获Webdriver初始化错误

时间:2018-11-05 06:52:39

标签: selenium-webdriver protractor

我想捕获/处理此错误:

    07:28:34 > protractor protractor.config.js
    07:28:34 [07:28:34] I/launcher - Running 1 instances of WebDriver
    07:28:34 [07:28:34] I/direct - Using ChromeDriver directly...
    07:28:35 [07:28:34] E/launcher - unknown error: Chrome failed to start: exited abnormally
    07:28:35   (unknown error: DevToolsActivePort file doesn't exist)
    07:28:35   (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    07:28:35   (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 3.10.0-862.14.4.el7.x86_64 x86_64)
    07:28:35 [07:28:34] E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally
    07:28:35   (unknown error: DevToolsActivePort file doesn't exist)
    07:28:35   (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
    07:28:35   (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 3.10.0-862.14.4.el7.x86_64 x86_64)
    07:28:35     at Object.checkLegacyResponse (/opt/jenkins/workspace/monitoring-app/node_modules/selenium-webdriver/lib/error.js:546:15)
    07:28:35     at parseHttpResponse (/opt/jenkins/workspace/monitoring-app/node_modules/selenium-webdriver/lib/http.js:509:13)
    07:28:35     at doSend.then.response (/opt/jenkins/workspace/monitoring-app/node_modules/selenium-webdriver/lib/http.js:441:30)
    07:28:35     at process._tickCallback (internal/process/next_tick.js:68:7)
    07:28:35 From: Task: WebDriver.createSession()
    07:28:35     at Function.createSession
[...]
    07:28:35 [07:28:34] E/launcher - Process exited with error code 199
    07:28:35 npm ERR! Test failed.  See above for more details.

我在哪里可以做到?在protractor.config.js中?

0 个答案:

没有答案