Skip to content

Commit d2b1c51

Browse files
committed
It's expected that an element might not be present...
... when waiting for the element to be present. Closes #3552
1 parent c624cc0 commit d2b1c51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,9 @@ public String toString() {
893893
private static WebElement findElement(By by, WebDriver driver) {
894894
try {
895895
return driver.findElements(by).stream().findFirst().orElseThrow(
896-
() -> new NoSuchElementException("Cannot locate an element using " + by));
896+
() -> new NoSuchElementException("Cannot locate an element using " + by));
897+
} catch (NoSuchElementException e) {
898+
throw e;
897899
} catch (WebDriverException e) {
898900
log.log(Level.WARNING,
899901
String.format("WebDriverException thrown by findElement(%s)", by), e);

0 commit comments

Comments
 (0)