I need to check the existence of Alert in WebDriver.
Sometimes it pops up an alert but sometimes it will not pop up. I need to check if the alert exists first, then
public boolean isAlertPresent() {
try { driver.switchTo().alert(); system.out.println(" Alert Present"); } catch (NoAlertPresentException e) { system.out.println("No Alert Present"); }
}