Package org.openqa.selenium

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


        ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
        changePasswordPage.changePassword(PASSWORD_1, PASSWORD_2);
        changePasswordPage.submit();
        Alert alert = getDriver().switchTo().alert();
        Assert.assertEquals(PASSWORD_MISMATCH, alert.getText());
        alert.accept();
    }

    @Test
    public void testChangePasswordWithoutEnteringPasswords()
    {
View Full Code Here


        PreferencesUserProfilePage preferencesPage = this.customProfilePage.switchToPreferences();
        ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
        changePasswordPage.submit();
        Alert alert = getDriver().switchTo().alert();
        Assert.assertEquals(PASSWORD_IS_EMPTY, alert.getText());
        alert.accept();
    }

    @Test
    public void testChangePasswordOfAnotherUserWithTwoDifferentPasswords()
    {
View Full Code Here

        ChangePasswordPage changePasswordPage = preferencesPage.changePassword();
        changePasswordPage.changePassword(PASSWORD_1, PASSWORD_2);
        changePasswordPage.submit();
        Alert alert = getDriver().switchTo().alert();
        Assert.assertEquals(PASSWORD_MISMATCH, alert.getText());
        alert.accept();
    }
}
View Full Code Here

    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

        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());
View Full Code Here

            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

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

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

    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

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

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.