Package org.openqa.selenium

Examples of org.openqa.selenium.Alert.accept()


    // Click on Send Registration Keys
    waitForElementPresent(By.id("dataform"));
    waitAndClick(By.className("t_remind_students"));
    // Click yes to confirmation
    Alert alert = driver.switchTo().alert();
    alert.accept();

    waitForElementText(By.id("statusMessage"),
        "Emails have been sent to unregistered students.");

    waitAWhile(5000);
View Full Code Here


    waitAndClick(By.className("t_course_view"));
    waitAndClick(By.xpath(String.format(
        "//table[@id='dataform']//tr[%d]//a[4]", 6)));
    // Click yes to confirmation
    Alert alert = driver.switchTo().alert();
    alert.accept();
  }

}
View Full Code Here

    // Click Evaluations
    wdClick(By.className("t_evaluations"));
    waitAndClick(By.className("t_eval_remind"));
  // Click yes to confirmation
      Alert alert = driver.switchTo().alert();
      alert.accept();

    justWait();

    // Confirm Email
    for (int i = 0; i < sc.students.size(); i++) {
View Full Code Here

  private String closeAlertAndGetItsText() {
    try {
      Alert alert = driver.switchTo().alert();
      String alertText = alert.getText();
      if (acceptNextAlert) {
        alert.accept();
      } else {
        alert.dismiss();
      }
      return alertText;
    } finally {
View Full Code Here

      WebElement signOutLink = SeleniumUtils.findElement(driver,
          "//a[contains(text(), '" + getString(310) + "')]", true, true);
      signOutLink.click();
     
      Alert alert = driver.switchTo().alert();
      alert.accept();
     
      // ##################################
      // Sign up with same user and email and check duplicate messages
      // ##################################
     
View Full Code Here

    } catch (UnhandledAlertException e) {
      if (retryIfAlert) {
        try {
          Alert alert = webdriver.switchTo().alert();
          System.err.println(e + ": " + alert.getText());
          alert.accept();
          savePageSourceToFile(fileName, webdriver, false);
        }
        catch (Exception unableToCloseAlert) {
          System.err.println("Failed to close alert: " + unableToCloseAlert);
        }
View Full Code Here

 
  public void javascript_popup_click_ok() {
    Alert alert = get_current_alert_box();
    if(alert != null) {
      action("Accepted the javascript popup '" + alert.getText() + "'");
      alert.accept();
    }
  }
 
  public void javascript_popup_dismiss() {
    if(browser.is_Chrome()) {
View Full Code Here

 
  public void javascript_popup_click_ok() {
    Alert alert = get_current_alert_box();
    if(alert != null) {
      action("Accepted the javascript popup '" + alert.getText() + "'");
      alert.accept();
    }
  }
 
  public void javascript_popup_dismiss() {
    if(browser.is_Chrome()) {
View Full Code Here

 
  public void javascript_popup_click_ok() {
    Alert alert = get_current_alert_box();
    if(alert != null) {
      action("Accepted the javascript popup '" + alert.getText() + "'");
      alert.accept();
    }
  }
 
  public void javascript_popup_dismiss() {
    if(browser.is_Chrome()) {
View Full Code Here

      el.click();
      Assert.fail();
    } catch (UnhandledAlertException e) {
      //expected
    }
    alert.accept();
    el.click();
    driver.switchTo().alert();
    alert.accept();
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.