我对这个新的错误感到困惑,这个错误开始发生在我现有的工作项目上,即使我没有对代码做任何更改来导致这种情况发生(但这可能是由于火狐更新,或者依赖突然失败)。在它开始发生后,我添加了catch以帮助调试导致突然退出的原因:
var prom = new Builder()
.forBrowser('firefox')
.build()
prom.catch((e) => {
console.log(e)
})
let driver: WebDriver = await prom
基本上,当我的代码到达这个代码块的最后一行时,它会弹出一个firefox窗口,等待大约70秒(现在应该已经实现了承诺),然后抛出一个错误,该错误指向catch并将其记录到控制台:
{ WebDriverError: newSession
at Object.throwDecodedError (\path\to\node_modules\selenium-webdriver\lib\error.js:550:15)
at parseHttpResponse (\path\to\node_modules\selenium-webdriver\lib\http.js:542:13)
at Executor.execute (\path\to\node_modules\selenium-webdriver\lib\http.js:468:26)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
name: 'WebDriverError',
remoteStacktrace: 'WebDriverError@chrome://marionette/content/error.js:178:5\nUnknownCommandError@chrome://marionette/content/error.js:472:5\ndespatch@chrome://marionette/content/server.js:290:13\nexecute@chrome://marionette/content/server.js:271:11\nonPacket/<@chrome://marionette/content/server.js:246:15\nonPacket@chrome://marionette/content/server.js:245:8\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:490:9\n' }
有趣的是,当使用Visual Studio检查WebDriverError对象时,它说它有一个消息属性“newsession”,出于某种原因,它不会被记录到控制台(或在我尝试时被串化)。
无论如何,这个错误构造得很差,因为“newsession”并没有告诉我任何接近足够的信息来跟踪出了什么问题。
有人能帮我确定在等待70秒的时间吗?
更新
:
我确定了它正在等待的Web请求(向
http://localhost:51290/session
,其中端口在每次运行时都不同)。就是这个请求在70秒后超时。我可以通过发送
{}
到URL(也会弹出一个firefox窗口)。但是,如果我将soapui中的超时设置为巨大的值,那么json响应当然是:
{"value": {
"error": "unknown error",
"message": "newSession",
"stacktrace": "WebDriverError@chrome://marionette/content/error.js:178:5\nUnknownCommandError@chrome://marionette/content/error.js:472:5\ndespatch@chrome://marionette/content/server.js:290:13\nexecute@chrome://marionette/content/server.js:271:11\nonPacket/<@chrome://marionette/content/server.js:246:15\nonPacket@chrome://marionette/content/server.js:245:8\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:490:9\n"
}}
我想我需要调试这方面的火狐,有人能让我开始吗?