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 has been 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
Open
Avijoy7 opened this issue
May 28, 2022
· 2 comments
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".
Looking for a solution, thanks in advance
The text was updated successfully, but these errors were encountered:
@Avijoy7 : You can use afterEach function to achieve this
afterEach (function(){
driver.close();
});
I have already mentioned in the description that methods like, restart(), close(), quit() are not working. It's not about creating another block of afterEach. anyways, thanks for your help
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there!
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 :
#My spec 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".
Looking for a solution, thanks in advance
The text was updated successfully, but these errors were encountered: