-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Labels
B-supportIssue or PR related to support classesIssue or PR related to support classesC-javaJava BindingsJava BindingsI-defectSomething is not working as intendedSomething is not working as intended
Milestone
Description
Description
Selenium Java binding has a bunch of built-in checks: ExpectedConditions.
They are meant to wait for some time until the desired condition is met.
I found that some of these conditions do not wait. Instead, they throw an exception right away. :(
This is clearly a bug.
Reproducible Code
Given "waiter" with timeout 5 seconds
FluentWait<WebDriver> wait = new FluentWait<>(driver)
.withTimeout(ofSeconds(5))and an element that appears after ~2 seconds:
<div id="slow-cow" value="cow-123">Moooooooo</div>These checks should wait for ~2 seconds and complete successfully:
wait.until(presenceOfElementLocated(By.cssSelector("#slow-cow")));
wait.until(textToBePresentInElementLocated(slow, "Moooooooo"));
wait.until(textToBePresentInElementValue(slow, "cow-123"));
wait.until(elementToBeSelected(slow));
wait.until(elementSelectionStateToBe(slow, true));
wait.until(attributeToBe(slow, "value", "cow-123"));
wait.until(attributeContains(slow, "value", "cow-123"));
wait.until(presenceOfNestedElementLocatedBy(By.cssSelector("body"), slow));
wait.until(presenceOfNestedElementLocatedBy(driver.findElement(By.cssSelector("body")), slow));
wait.until(frameToBeAvailableAndSwitchToIt(By.id("slow-frame"))); // throws NoSuchElementException without waitingBut all they just throw immediately NoSuchElementException without any waiting. :(
Metadata
Metadata
Assignees
Labels
B-supportIssue or PR related to support classesIssue or PR related to support classesC-javaJava BindingsJava BindingsI-defectSomething is not working as intendedSomething is not working as intended