You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating my customDriver.js based on the Firefox driver defined in the selenium-cucumber-js repository mainly to set custom browser Options (headless, private, etc.) the app is throwing the following NoSuchSessionError:
NoSuchSessionError: Tried to run command without establishing a connection
at Object.throwDecodedError (/home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/error.js:514:15)
at parseHttpResponse (/home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/http.js:519:13)
at /home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.quit()
at thenableWebDriverProxy.schedule (/home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
at thenableWebDriverProxy.quit (/home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/webdriver.js:840:23)
at /home/ubuntu/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node13/lib/node_modules/selenium-cucumber-js/runtime/world.js:175:27
at ManagedPromise.invokeCallback_ (/home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/promise.js:1376:14)
at TaskQueue.execute_ (/home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/promise.js:3084:14)
at TaskQueue.executeNext_ (/home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/promise.js:3067:27)
at /home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/promise.js:2927:27
at /home/ubuntu/workspace/b2b-portal_dev/node_modules/selenium-webdriver/lib/promise.js:668:7
at processTicksAndRejections (internal/process/task_queues.js:93:5)
After troubleshooting, the error seems related to the closeBrowser() function where basically Firefox cannot be closed "twice". However, since browserName variable seems not being set for custom driver.
// firefox quits on driver.close on the last window
returndriver.close().then(function(){
if(browserName!=='firefox'){
returndriver.quit();
}
});
}
@john-doherty would you consider instead of relying on the browserName variable set in getDriverInstance() function to query the browserName from the current driver session via the following snippet?
functioncloseBrowser(){driver.getCapabilities().then(function(caps){browserName=caps.get("browserName");});// firefox quits on driver.close on the last windowreturndriver.close().then(function(){if(browserName!=='firefox'){returndriver.quit();}});}
The text was updated successfully, but these errors were encountered:
When creating my customDriver.js based on the Firefox driver defined in the selenium-cucumber-js repository mainly to set custom browser Options (headless, private, etc.) the app is throwing the following NoSuchSessionError:
After troubleshooting, the error seems related to the closeBrowser() function where basically Firefox cannot be closed "twice". However, since browserName variable seems not being set for custom driver.
selenium-cucumber-js/runtime/world.js
Lines 171 to 178 in 23d40df
@john-doherty would you consider instead of relying on the browserName variable set in getDriverInstance() function to query the browserName from the current driver session via the following snippet?
The text was updated successfully, but these errors were encountered: