Pages

Tuesday, February 11, 2014

Selenium WebDriver pop up AlertAndConfirmationBox code

Alert confrmationBox = driver.switchTo().alert();
System.out.println(confrmationBox.getText());
Thread.sleep(1000L);
confrmationBox.dismiss();

Alert alertBox = driver.switchTo().alert();
System.out.println(alertBox.getText());
Thread.sleep(1000L);
alertBox.accept();

No comments:

Post a Comment