Examples of WebDriverWait


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

  public boolean isProfileCardDisplayable(WebElement cardAttachPoint){
    WebDriver driver = getWebDriver();
   
    new Actions(driver).moveToElement(cardAttachPoint).perform(); // hover over the attachpoint to make the semtagmenu appear.
   
    WebDriverWait wait = new WebDriverWait(driver, 5);
    WebElement semtagmenu = wait.until(ExpectedConditions.elementToBeClickable(By.id("semtagmenu"))); // wait until the hover menu is clickable.
   
    WebElement semTagHoverMenu = semtagmenu.findElement(By.xpath(".//a"));
    new Actions(driver).click(semTagHoverMenu).perform(); // click the hovering menu
    WebElement vCardDiv = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("cardDiv")));
   
    return vCardDiv.isDisplayed();
  }
View Full Code Here

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

  }

  protected final void waitForElement(WebDriver driver, org.openqa.selenium.By by, long timeOut) {
    WebElement
        element =
        (new WebDriverWait(driver, timeOut))
            .until(ExpectedConditions.visibilityOfElementLocated(by));
  }
View Full Code Here

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

  public void testCanUseEnterKeyToSubmitForm() {
    driver.get(pages.formPage);
    WebElement element = driver.findElement(By.cssSelector("#nested_form input[type='text']"));
    final String curURL = driver.getCurrentUrl();
    element.sendKeys("something" + Keys.ENTER);
    new WebDriverWait(driver, 3).until(new ExpectedCondition<Boolean>() {
      @Override
      public Boolean apply(WebDriver webDriver) {
        return !webDriver.getCurrentUrl().equals(curURL);
      }
    });
View Full Code Here

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

  public void testCanUseReturnKeyToSubmitForm() {
    driver.get(pages.formPage);
    WebElement element = driver.findElement(By.cssSelector("#nested_form input[type='text']"));
    final String curURL = driver.getCurrentUrl();
    element.sendKeys("something" + Keys.RETURN);
    new WebDriverWait(driver, 3).until(new ExpectedCondition<Boolean>() {
      @Override
      public Boolean apply(WebDriver webDriver) {
        return !webDriver.getCurrentUrl().equals(curURL);
      }
    });
View Full Code Here

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

        dc.setCapability("jenkins.label", "foo");
        WebDriver wd = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc);

        try {
            wd.get("http://www.google.com/");
            new WebDriverWait(wd, 10).until(ExpectedConditions.presenceOfElementLocated(By.tagName("title")));
        } finally {
            wd.quit();
        }

        dc = DesiredCapabilities.htmlUnit();
View Full Code Here

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

        WebElement sendBtn = this.driver.findElement(By.id("send-btn"));
        sendBtn.click();

        // wait 5 secs for ajax response
        new WebDriverWait(this.driver, 5).until(
                ExpectedConditions.textToBePresentInElement(By.id("response"), whoToSend)
        );

        WebElement response = this.driver.findElement(By.id("response"));
        String text = response.getText();
View Full Code Here

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

  public void waitUntil(final Predicate<Void> predicate) {
      waitUntil(5, predicate);
    }
 
  public void waitUntil(long timeOutInSeconds, final Predicate<Void> predicate) {
      new WebDriverWait(webDriver, timeOutInSeconds).until(
          new ExpectedCondition<Boolean>(){

        public Boolean apply(WebDriver webDriver) {
          return predicate.apply(null);
        }
View Full Code Here

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

import org.openqa.selenium.support.ui.WebDriverWait;

public class DialogTestUtils
{
   public static WebElement waitForModalToAppear(WebDriver driver) {
      return (new WebDriverWait(driver, 2))
        .until(ExpectedConditions.presenceOfElementLocated(
              By.className("gwt-DialogBox-ModalDialog")));
   }
View Full Code Here

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

        .until(ExpectedConditions.presenceOfElementLocated(
              By.className("gwt-DialogBox-ModalDialog")));
   }
  
   public static void waitForModalToDisappear(final WebDriver driver) {
      (new WebDriverWait(driver, 5)).until(new ExpectedCondition<Boolean>() {
         public Boolean apply(WebDriver d) {
            List<WebElement>elements = driver.findElements(By.className(
                  "gwt-DialogBox-ModalDialog"));
            return elements.size() == 0;
         }
View Full Code Here

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

            button.click();
            break;
         }
      }
     
      (new WebDriverWait(driver, 5)).until(
            ExpectedConditions.stalenessOf(dialog));
   }
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.