I know you can use driver.quit()
and driver.close()
but how to close nicely when executed multiple processes?
IDEAS:
- Use process ID?
I know you can use driver.quit()
and driver.close()
but how to close nicely when executed multiple processes?
IDEAS:
Using Selenium to end the WebDriver and Web Browser session graciously you should invoke the quit()
method within the tearDown() {}
. Invoking quit() deletes the current browsing session through sending quit
command with {"flags":["eForceQuit"]}
and finally sends the GET
request on /shutdown
endpoint. Here is the relevant log:
1503397488598 webdriver::server DEBUG -> DELETE /session/8e457516-3335-4d3b-9140-53fb52aa8b74
1503397488607 geckodriver::marionette TRACE -> 37:[0,4,"quit",{"flags":["eForceQuit"]}]
1503397488821 webdriver::server DEBUG -> GET /shutdown
So on invoking quit()
method the Web Browser session and the WebDriver instance gets killed completely.
You can find a couple of relevant detailed discussions in: