I got an issue with Selenium throwing timeout exception because of a pop up window
unexpected alert open
not provide any stacktrace inform
Try this,
public boolean isAlertPresent() {
boolean presentFlag = false;
try {
// Check the presence of alert
Alert alert = driver.switchTo().alert();
// Alert present; set the flag
presentFlag = true;
// if present consume the alert
alert.accept();
//( Now, click on ok or cancel button )
} catch (NoAlertPresentException ex) {
// Alert not present
ex.printStackTrace();
}
return presentFlag;
}
I hope this will helpful to you.