Example #1
0
 public List<WebElement> findElementsWithoutWaiting(WebDriver driver, WebElement element, By by) {
   // Temporarily remove the implicit wait on the driver since we're doing our own waits...
   driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
   try {
     return element.findElements(by);
   } finally {
     setDriverImplicitWait(driver);
   }
 }
Example #2
0
  public <T> void waitUntilCondition(ExpectedCondition<T> condition) {
    // Temporarily remove the implicit wait on the driver since we're doing our own waits...
    getDriver().manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);

    Wait<WebDriver> wait = new WebDriverWait(getDriver(), getTimeout());
    try {
      wait.until(condition);
    } finally {
      // Reset timeout
      setDriverImplicitWait(getDriver());
    }
  }