使用selenium网格启动测试时,我遇到了一些奇怪的错误。上下文:我在我的量角器-conf.js上定义了很多套件,并在管道上使用了grunt启动测试。我在我的网格集线器(' https://path:4444/wd/hub')上工作的selenium服务器负责将测试转发给20个已安装了chromedriver以运行测试的从站。在大多数情况下,我不会遇到任何问题,我能够成功触发这个过程,一切正常。但是,有时我会收到以下错误:
13:37:05 [chrome #1-4] Using the selenium server at http://path:4444/wd/hub
13:37:05 [chrome #1-4]
13:37:05 [chrome #1-4] /PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:108
13:37:05 [chrome #1-4] var template = new Error(this.message);
13:37:05 [chrome #1-4] ^
13:37:05 [chrome #1-4] UnknownError: Error forwarding the new session Error forwarding the request Read timed out
13:37:05 [chrome #1-4] at new bot.Error (/PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:108:18)
13:37:05 [chrome #1-4] at Object.bot.response.checkResponse (/PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:109:9)
13:37:05 [chrome #1-4] at /PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:160:24
13:37:05 [chrome #1-4] at [object Object].promise.ControlFlow.runInFrame_ (eval at (/PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1124:19), :1857:20)
13:37:05 [chrome #1-4] at [object Object].goog.defineClass.notify (eval at (/PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1124:19), :2448:25)
13:37:05 [chrome #1-4] at [object Object].promise.Promise.notify_ (eval at (/PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1124:19), :564:12)
13:37:05 [chrome #1-4] at Array.forEach (native)
13:37:05 [chrome #1-4] at [object Object].promise.Promise.notifyAll_ (eval at (/PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1124:19), :553:15)
13:37:05 [chrome #1-4] at [object Object].goog.async.run.processWorkQueue as _onTimeout
13:37:05 [chrome #1-4] at Timer.listOnTimeout as ontimeout
13:37:05 [chrome #1-4] From: Task: WebDriver.createSession()
13:37:05 [chrome #1-4] at Function.webdriver.WebDriver.acquireSession_ (/PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)
13:37:05 [chrome #1-4] at Function.webdriver.WebDriver.createSession (/PATH/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)
13:37:05 [chrome #1-4] at [object Object].Builder.build (/PATH/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22)
13:37:05 [chrome #1-4] at [object Object].DriverProvider.getNewDriver (/PATH/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
13:37:05 [chrome #1-4] at [object Object].Runner.createBrowser (/PATH/node_modules/protractor/lib/runner.js:182:37)
13:37:05 [chrome #1-4] at driverprovider_.setupEnv.then.then.then.frameworkPath (/PATH/node_modules/protractor/lib/runner.js:263:21)
13:37:05 [chrome #1-4] at _fulfilled (/PATH/node_modules/protractor/node_modules/q/q.js:797:54)
13:37:05 [chrome #1-4] at self.promiseDispatch.done (/PATH/node_modules/protractor/node_modules/q/q.js:826:30)
13:37:05 [chrome #1-4] at Promise.promise.promiseDispatch (/PATH/node_modules/protractor/node_modules/q/q.js:759:13)
13:37:05 [chrome #1-4] at /PATH/node_modules/protractor/node_modules/q/q.js:525:49
13:37:05
13:37:05 [launcher] Runner process exited unexpectedly with error code: 1
我必须说,这与成功执行的代码库相同。例如,我将一些东西推到我的管道上,测试运行并且一切都通过了。然后我使用完全相同的代码库/环境重新启动作业并发生错误(错误可能先发生然后消失,这不符合特定规则)。如有必要,我可以提供更多信息。
提前致谢。