Examples of Alert


Examples of org.openqa.selenium.Alert

            return false;
        }
    }

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

Examples of org.openqa.selenium.Alert

        openTestURL();

        try {
            new WebDriverWait(driver, 10).until(ExpectedConditions
                    .alertIsPresent());
            Alert alert = driver.switchTo().alert();
            assertEquals("First", alert.getText());
            alert.accept();

            new WebDriverWait(driver, 10).until(ExpectedConditions
                    .alertIsPresent());
            alert = driver.switchTo().alert();
            assertEquals("Second", alert.getText());
            alert.accept();

        } catch (TimeoutException te) {
            fail("@Javascript widget loading halted.");
        }
View Full Code Here

Examples of org.openqa.selenium.Alert

  public void handleFormWithJavascriptAction() {
    String url = appServer.whereIs("form_handling_js_submit.html");
    driver.get(url);
    WebElement element = driver.findElement(By.id("theForm"));
    element.submit();
    Alert alert = driver.switchTo().alert();
    String text = alert.getText();
    alert.dismiss();

    assertEquals("Tasty cheese", text);
  }
View Full Code Here

Examples of org.openqa.selenium.Alert

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

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

    waitAWhile(5000);
    System.out.println("Collecting registration keys.");
View Full Code Here

Examples of org.openqa.selenium.Alert

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

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

    waitAWhile(5000);
    System.out.println("Collecting registration keys.");
View Full Code Here

Examples of org.openqa.selenium.Alert

    // Click the first Publish available
    waitAndClick(By.className("t_eval_publish"));
    // Click Yes
    // wdClick(By.className("t_yes"));
    // Click yes to confirmation
    Alert alert = driver.switchTo().alert();
    alert.accept();

    waitForElementText(By.id("statusMessage"),
        "The evaluation has been published.");

    // Check for status: PUBLISHED
View Full Code Here

Examples of org.openqa.selenium.Alert

    // Click the first unpublish available
    waitAndClick(By.className("t_eval_unpublish"));
    // Click Yes
    // Click yes to confirmation
    Alert alert = driver.switchTo().alert();
    alert.accept();

    waitForElementText(By.id("statusMessage"),
        "The evaluation has been unpublished.");

    // Check for status: PUBLISHED
View Full Code Here

Examples of org.openqa.selenium.Alert

    // 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

Examples of org.openqa.selenium.Alert

    // Click Evaluations
    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

Examples of org.openqa.selenium.Alert

  public void testRemindEvaluation() throws Exception {
    // 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
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.