Examples of WebDriverWait


Examples of org.openqa.selenium.support.ui.WebDriverWait

   */
  public WebElement waitForLoginForm(final int secs, final String[] ids,
      final String[] xpathExprs, final String[] titles,
      final BaseTest baseTest) {
    try {
      return (new WebDriverWait(getPageObject().getWebDriver(), secs))
          .pollingEvery(1, TimeUnit.SECONDS).until(
              new ExpectedCondition<WebElement>() {

                boolean lookForResult = false;

View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

   * Wait the specified interval for the specified web element to be available
   */
  public WebElement waitForElement(final String match, final int secs,
      final String condition) {
    try {
      return (new WebDriverWait(getPageObject().getWebDriver(), secs))
          .until(new ExpectedCondition<WebElement>() {
            @Override
            public WebElement apply(WebDriver webDriver) {
              failIfPageCrashed(webDriver);
              webDriver = getPageObject(webDriver).getWebDriver();
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

   * Wait the specified interval for the specified web element to be available
   * and for it to have non empty content
   */
  public WebElement waitForText(final String id, final int secs) {
    try {
      return (new WebDriverWait(getPageObject().getWebDriver(), secs))
          .until(new ExpectedCondition<WebElement>() {
            @Override
            public WebElement apply(WebDriver webDriver) {
              failIfPageCrashed(webDriver);
              webDriver = getPageObject(webDriver).getWebDriver();
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

   *            This is the text that you expect the element to have
   */
  public WebElement waitForText(final String xPath, final int secs,
      final String expectedText) {
    try {
      return (new WebDriverWait(getPageObject().getWebDriver(), secs))
          .until(new ExpectedCondition<WebElement>() {
            @Override
            public WebElement apply(WebDriver webDriver) {
              failIfPageCrashed(webDriver);
              webDriver = getPageObject(webDriver).getWebDriver();
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

   * with the specified children
   */
  public WebElement waitForChildren(final String tagName, final String xpath,
      final int secs) {
    try {
      return (new WebDriverWait(getPageObject().getWebDriver(), secs))
          .until(new ExpectedCondition<WebElement>() {
            @Override
            public WebElement apply(WebDriver webDriver) {
              failIfPageCrashed(getPageObject(webDriver)
                  .getWebDriver());
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

    private boolean checkCodeDivs(SampleFrameworkResultPage resultPage) {
        WebElement jspDiv = resultPage.getJspSnippetDiv();
        String jspContent = jspDiv.getAttribute("innerHTML");
        WebElement ulNav = resultPage.getCodeNav();
        List<WebElement> tabList = ulNav.findElements(By.xpath(".//a"));
        WebDriverWait wait = new WebDriverWait(resultPage.getWebDriver(), 2);
        tabList.get(1).click();
        boolean docDivDisplayed = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(SampleFrameworkResultPage.DOCSNIPPETDIV))).isDisplayed();

        return jspContent != null && docDivDisplayed;
    }
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

    private boolean checkCodeDivs(SampleFrameworkResultPage resultPage) {
        WebElement jsDiv = resultPage.getJsSnippetDiv();
        String jsContent = jsDiv.getAttribute("innerHTML");
        WebElement ulNav = resultPage.getCodeNav();
        List<WebElement> tabList = ulNav.findElements(By.xpath(".//a"));
        WebDriverWait wait = new WebDriverWait(resultPage.getWebDriver(), 5l);
        tabList.get(1).click();
        boolean htmlDivDisplayed = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(SampleFrameworkResultPage.HTMLSNIPPETDIV))).isDisplayed();
        tabList.get(2).click();
        boolean cssDivDisplayed = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(SampleFrameworkResultPage.CSSSNIPPETDIV))).isDisplayed();
        tabList.get(3).click();
        boolean docDivDisplayed = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(SampleFrameworkResultPage.DOCSNIPPETDIV))).isDisplayed();

        return jsContent != null && htmlDivDisplayed && cssDivDisplayed && docDivDisplayed;
    }
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

     *
     * @param snippetId - the sample framework page
     * @return true if displayed
     */
    public boolean checkIframe(SampleFrameworkResultPage resultPage) {
        WebDriverWait wait = new WebDriverWait(resultPage.getWebDriver(), 20l);
        WebElement iframeBody = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("body")));
        String bodyClass = iframeBody.getAttribute("class");
       
        return bodyClass != null;
    }
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

   * Wait the specified interval for the specified web element to be available
   */
  public WebElement waitForText(final String id, final String match,
      final int secs) {
    try {
      return (new WebDriverWait(getPageObject().getWebDriver(), secs))
          .until(new ExpectedCondition<WebElement>() {
            @Override
            public WebElement apply(WebDriver webDriver) {
              failIfPageCrashed(getPageObject(webDriver)
                  .getWebDriver());
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

   * Get the html ul representing the navigation options in the community card.
   *
   * @return the WebElement
   */
  public WebElement waitForCommunityCardNav(){
    WebDriverWait wait = new WebDriverWait(getWebDriver(), 5);
    WebElement result = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("bizCardNav"))); // wait until the community card nav is available.
   
    return result;
  }
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.