Selenium: alert handling with Selenium WebDriver

Last updated on:

There is lots of JavaScript on modern web pages and quite often you would see alerts, here is how you can handle it:

Alert alert = driver.switchTo().alert();

alert.dismiss();
alert.accept();
View Comments

Leave a Comment

Use markdown or basic HTML and be nice.