Selenium close browser- How to close the whole browser window by keeping the WebDriver active?

653    Asked by GabrielleDowd in QA Testing , Asked on Jun 15, 2021

In my batch execution, multiple browsers with multiple tabs are getting opened for the first scenario. I wanted to close all these browsers before starting the second scenario.

Driver.close() is just closing one tab of the browser. Driver.quit() is closing all the browsers and also ending the WebDriver session. So, am unable to run the batch execution. Please provide a solution for this.

Your Answer

Interviews

Parent Categories