Reputation:
Whenever I call driver.quit()
it waits for the website to first complete loading then it closes the browser, is there any way I can force close the browser immediately?
Upvotes: 0
Views: 814
Reputation: 193308
When you invoke get()
for an url
using Selenium a lot many actions happens under the hood, including HTTP requests received by geckodriver, packets sent to and from the remote protocol in Firefox, and responses sent back to your client.
Once the basic mandatory requests/responses are successfully completed, based on the pageLoadStrategy the browser i.e. the client sends back the program control to Selenium to perform the next line of code.
Now pageLoadStrategy
can be either of the following:
So once the program control is returned back to Selenium based on pageLoadStrategy which is somewhat timebound, then only driver.quit()
can be performed.
Upvotes: 1