Package org.openqa.selenium.support.ui

Examples of org.openqa.selenium.support.ui.WebDriverWait.until()


            "return $(\"td:contains('" + LOCAL_PLUGIN_NAME + "')\").toArray();");
        return plugins.size() > existingPlugins.size();
      }
    };
    WebDriverWait wait = new WebDriverWait(driver, 60);
    wait.until(uploaded);

    List<WebElement> plugins = (List<WebElement>) ((JavascriptExecutor)driver).executeScript(
        "return $(\"td:contains('" + LOCAL_PLUGIN_NAME + "')\").toArray();");
    assertEquals(existingPlugins.size() + 1, plugins.size());
  }
View Full Code Here


            "return $(\"td:contains('" + REMOTE_PLUGIN_NAME + "')\").toArray();");
        return plugins.size() > existingPlugins.size();
      }
    };
    WebDriverWait wait = new WebDriverWait(driver, 60);
    wait.until(uploaded);

    List<WebElement> plugins = (List<WebElement>) ((JavascriptExecutor)driver).executeScript(
        "return $(\"td:contains('" + REMOTE_PLUGIN_NAME + "')\").toArray();");
    assertEquals(existingPlugins.size() + 1, plugins.size());
  }
View Full Code Here

          WebElement notification = driver.findElements(By.id("notification")).get(0);
          return notification.getText().equals("Plugin Deleted");
        }
      };
      WebDriverWait wait = new WebDriverWait(driver, 10);
      wait.until(isDeleted);
      deleteLinks = (List<WebElement>) ((JavascriptExecutor)driver).executeScript(
          "return $(\"a:contains('Delete')\").toArray()");
    }

    driver.navigate().refresh();
View Full Code Here

    private static WebDriver driver = BasePage.driver;

    public static void waitForElementPresent(String xpath) {
        WebDriverWait wait = new WebDriverWait(driver, 10);
        WebElement element = wait.until(
                ExpectedConditions.visibilityOfElementLocated(By.xpath(xpath)));
    }

    public static boolean isElementPresent(String xpath) {
        return driver.findElements(By.xpath(xpath)).size() > 0;
View Full Code Here

   */
  public boolean menuUsuarioVisivel() {
    boolean resultado = false;
    try {
      WebDriverWait wait = new WebDriverWait(Webdriver.obterInstancia(), 15);
      wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("userSideNavBar")));
      resultado = true;
    } catch (Exception e) {
      resultado = false;
    }
    return resultado;
View Full Code Here

    WebDriverWait wait = new WebDriverWait(driver, getTimeout());
    // wait for Login, but we are not gonna click it testing AUTOACCEPT works.
    // TODO fix assumption that all sites have a direct Login page, but not all do. 
    if (loginLoadedLinkText != null &&  !loginLoadedLinkText.equals(""))
    {
      wait.until(ExpectedConditions.elementToBeClickable(By.linkText(loginLoadedLinkText)));
    }
    else
    {
      wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("/html")));
    }
View Full Code Here

    {
      wait.until(ExpectedConditions.elementToBeClickable(By.linkText(loginLoadedLinkText)));
    }
    else
    {
      wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("/html")));
    }

    screenshot(); // of given loginUrl
   
    // various in page login pop-ups are detected by MP and can be submitted without clicking the link
View Full Code Here

    // various in page login pop-ups are detected by MP and can be submitted without clicking the link
    // that makes them visible.
    // TODO handle the other cases
    if (loginLoadedLinkText != null &&  !loginLoadedLinkText.equals(""))
    {
      wait.until(ExpectedConditions.elementToBeClickable(By.linkText(loginLoadedLinkText)));
    }

    Thread.sleep(1000);

    if (logoutLinkText != null &&  !logoutLinkText.equals(""))
View Full Code Here

    Thread.sleep(1000);

    if (logoutLinkText != null &&  !logoutLinkText.equals(""))
    {
      WebElement logout = wait.until(ExpectedConditions.elementToBeClickable(By.linkText(logoutLinkText)));
//      logout.click(); // clicking log out is nearly useless, MP will log back in immediately with AUTOACCEPT
    }
    else
    {
      wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("/html")));
View Full Code Here

      WebElement logout = wait.until(ExpectedConditions.elementToBeClickable(By.linkText(logoutLinkText)));
//      logout.click(); // clicking log out is nearly useless, MP will log back in immediately with AUTOACCEPT
    }
    else
    {
      wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("/html")));
    }
    screenshot();
  }
}
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.