I am doing some automated testing with Selenium C# Webdriver. And after finishing the tests I want to close the browser.
I initialize the driver with the following:
var driver = new ChromeDriver();
And then after doing something I am closing it with
driver.Close();
The browser is correcly closes, but there is a window which starts this browser which is still hanging.
Is there a way to close it as well?
This will close browser window as well as Chrome Driver prompt
ChromeOptions options = new ChromeOptions();
options.addArguments("no-sandbox");
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com/");
driver.close();
driver.quit();
driver.Close()
is intended to close popup browser windows, such as those opened by clicking on a link that triggers a window.open()
call in JavaScript. To be absolutely certain all resources are released and cleaned up by a driver, use driver.Quit()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With