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
{{ message }}
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Getting the ERROR "This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used." When I try to use restart() or close() method #5552
I am trying to execute an extremely simple code. No page object, no method calling from different classes , no customizing configuration file. I am just trying to open a browser, then close it and then open a new browser instance.
#My Conf.js file is :
I want to close the browser after each It block and open a new instance of a browser in the next It block. I know that we can use restartAfterEachTest in the configuration file to restart browsers, but I am not looking for that, I want to close and open browsers from my Spec file.
If I use browser.restart() it shows me the is error "This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used." and the IT block is failed.
If I use browser.close() , the first It block is passing but all subsequent It blocks are getting failed immediately and the error is "Invalid Session ID".