Handling Alerts (WebDriver) - Bug Reaper

                  Bug Reaper

Lean about Automation Testing,Selenium WebDriver,RestAssured,Appium,Jenkins,JAVA,API Automation,TestNG,Maven, Rest API, SOAP API,Linux,Maven,Security Testing,Interview Questions

Monday 23 September 2013

Handling Alerts (WebDriver)

Handling Alerts
Package Required for Alert----->  import org.openqa.selenium.Alert;

Three methods
Alert class provides various methods such as:
  1. accept()
  2. dismiss()
  3. getText()
Alert alert = driver.switchTo().alert();
System.out.println(alert.getText());
alert.accept();

No comments:

Post a Comment