Handling Alerts
Package Required for Alert-----> import org.openqa.selenium.Alert;
Three methods
Alert class provides various methods such as:
- accept()
- dismiss()
- getText()
Alert alert = driver.switchTo().alert();
System.out.println(alert.getText());
alert.accept();
No comments:
Post a Comment