Package org.openqa.selenium

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


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

        String rejectTMId = "rejectemptytmtest";

        TranslationMemoryPage tmMemoryPage = new TranslationMemoryWorkFlow()
                .createTranslationMemory(rejectTMId)
                .clickImport(rejectTMId);
        Alert uploadError = tmMemoryPage.expectFailedUpload();

        assertThat(uploadError.getText()
                .startsWith(TranslationMemoryPage.UPLOAD_ERROR)).isTrue()
                .as("Error is displayed");

        tmMemoryPage = tmMemoryPage.dismissError();
View Full Code Here

    try {
      writeToFile(webdriver.getPageSource(), pageSource);
    } 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

    assertEquals(CONFIG_URL, siteInput.getAttribute("value"));

    List<WebElement> deleteLink = driver.findElements(By.linkText("Delete Configuration"));
    followLink(deleteLink.get(0));

    Alert confirmDialog = driver.switchTo().alert();
    confirmDialog.accept();

    ExpectedCondition<Boolean> isDeleted = new ExpectedCondition<Boolean>() {
      public Boolean apply(WebDriver driver) {
        WebElement notification = driver.findElements(By.id("notification")).get(0);
        return notification.getText().equals("Configuration Deleted");
View Full Code Here

    List<WebElement> deleteLinks = driver.findElements(By.linkText("Delete"));

    while (deleteLinks.size() > 0) {
      followLink(deleteLinks.get(0));
      Alert confirmDialog = driver.switchTo().alert();
      confirmDialog.accept();
      ExpectedCondition<Boolean> isDeleted = new ExpectedCondition<Boolean>() {
        public Boolean apply(WebDriver driver) {
          WebElement notification = driver.findElements(By.id("notification")).get(0);
          return notification.getText().equals("Plugin Deleted");
        }
View Full Code Here

    openConfiguration();

    WebElement deleteLink = driver.findElement(By.linkText("Delete Configuration"));
    followLink(deleteLink);

    Alert confirmDialog = driver.switchTo().alert();
    confirmDialog.accept();

    open("configurations");
    if (isElementPresent(driver, By.linkText(CONFIG_NAME))) {
      List<WebElement> configurationLinks = driver.findElements(By.linkText(CONFIG_NAME));
      assertEquals(existingConfigurationLinks.size() - 1, configurationLinks.size());
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 {
            acceptNextAlert = true;
        }
View Full Code Here

  public void execute_async_javascript(String script, Object... args) {
    ((JavascriptExecutor) browser.driver()).executeAsyncScript(script, args);
  }
 
  public void javascript_popup_click_ok() {
    Alert alert = get_current_alert_box();
    if(alert != null) {
      action("Accepted the javascript popup '" + alert.getText() + "'");
      alert.accept();
    }
  }
View Full Code Here

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

TOP

Related Classes of org.openqa.selenium.Alert

Copyright © 2018 www.massapicom. 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.