Recently, a perplexing error surfaced in my previously functional project without any changes to the code. The sudden appearance of this issue may be attributed to a FireFox update or a dependency failure. To help troubleshoot the abrupt cessation, I added a catch block:
var prom = new Builder()
.forBrowser('firefox')
.build()
prom.catch((e) => {
console.log(e)
})
let driver: WebDriver = await prom
Upon reaching the final line of the code snippet above, a FireFox window pops up, lingers for around 70 seconds (when the promise should have been fulfilled), and then throws an error leading to the catch block where it is logged to the console:
{ 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' }
Interestingly, upon investigation using Visual Studio, the WebDriverError object supposedly has a "newSession" message property that fails to appear in the log or when stringified.
The error's construction is inadequate as "newSession" lacks sufficient detail to pinpoint the issue.
If anyone can assist me in identifying the cause of the ~70 second delay, I would greatly appreciate it.
UPDATE:
I have identified the specific web request causing the delay (a POST to http://localhost:51290/session
, varying ports). This request times out after 70 seconds. By replicating the timeout externally (e.g., using SoapUI) with {}
as the payload, a FireFox window also appears. However, setting a generous timeout in SoapUI prompts the following JSON response:
{"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"
}}
I suspect delving into debugging on the FireFox end might shed light on the issue. Can someone provide guidance in that direction?