Package org.openqa.selenium

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


            topTextField.sendKeys(String.valueOf(js.executeScript(TOP_COORDINATE_JS)));
            leftTextField.sendKeys(String.valueOf(js.executeScript(LEFT_COORDINATE_JS)));
            processButton.click();
            Alert alert = driver.switchTo().alert();
            s = alert.getText();
            alert.accept();
            //driver.switchTo().defaultContent();
        }
        return s;
    }
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

    } 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

    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

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

    } 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

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.