Hello,
I'm trying to set a WebDriverWait timeout smaller than implicitlyWait timeout, but it seems that the webdriver waits the full time(i guess at least the implicitlyWait timeout but it could be both timeouts cumulated).
In this example the test does not fail after 5 seconds. When eventually the test fails it says that it failed after a 5 seconds timeout:
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import
org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
public class test {
@Test
public void test(){
WebDriver driver=new FirefoxDriver();
driver.get("
http://www.google.com");
driver.manage().timeouts().implicitlyWait(120, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 5, 1500);
wait.until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver d) {
WebElement progress = d.findElement(By.name("bla bla bla"));
return progress.isDisplayed();
}
});
}
}
Now my question is : Is this a bug or a feature or am I doing something wrong?