从远程jenkins服务器运行量角器时。它抛出错误“无法启动WebDriver会话”。但是,我可以连接到jenkins-server / wd / hub来确认Webdriver正在运行。
请参阅下面的詹金斯控制台输出以解决此问题:
+ npm update
[web_smb] $ /bin/sh -xe /tmp/jenkins4067329780977120202.sh
[web_smb] $ /bin/sh -xe /tmp/jenkins1798873025562535727.sh
+ protractor --troubleshoot true ./test/config/jenkins.cucumber.conf.js
[06:31:21] D/launcher - Running with --troubleshoot
[06:31:21] D/launcher - Protractor version: 5.3.2
[06:31:21] D/launcher - Your base url for tests is https://<my-server-ip>
(node:9588) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[06:31:21] I/launcher - Running 1 instances of WebDriver
[06:31:21] I/hosted - Using the selenium server at http://<my-remote-jenkins-server>:4444/wd/hub
**[06:31:41] E/runner - Unable to start a WebDriver session.
(node:9588) UnhandledPromiseRejectionWarning: WebDriverError: Timed out waiting for driver server to start.**
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:19.891Z'
System info: host: 'svn.<XXXXX>.com', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-358.18.1.el6.x86_64', java.version: '9.0.1'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_8.11.3/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_8.11.3/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_8.11.3/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:9588) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9588) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[06:31:41] E/launcher - Error: WebDriverError: Timed out waiting for driver server to start.
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:19.891Z'
System info: host: 'svn.<XXXX>.com', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-358.18.1.el6.x86_64', java.version: '9.0.1'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_8.11.3/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_8.11.3/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_8.11.3/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[06:31:41] E/launcher - Process exited with error code 100
Build step 'Execute shell' marked build as failure