I'm facing a problem with my selenium tests. I have a script that do some stuff and then close the browser When i do close the browser there is a popup message (screen shot attached) that I need to accept in order for the browser to close. My problem is that I tried many different idea but none worked. from switch.accept to dismiss() to javascriptExecutor an no luck. This is the method Im using to close the broswer. after this method is called then i get the popup than i need to close.
public static void closeDriver() throws InterruptedException{
if(driver!=null){
driver.quit();
driver=null;
log.info("The Browser was closed successfully");
}