Skip to content

Commit

Permalink
'isInvisible()' returns true on 'NoSuchElementException' (#8063)
Browse files Browse the repository at this point in the history
The 'isInvisible()' method, when encountered with
'NoSuchElementException' causes 'TimeoutException',
whereas, it should return true.
Because if the element id not in DOM, it should be treated as invisible

Fixes #7518

Co-authored-by: Rahul Shah <[email protected]>
Co-authored-by: David Burns <[email protected]>
  • Loading branch information
3 people authored Mar 27, 2020
1 parent ef95e0c commit 624731c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ public String toString() {
private static boolean isInvisible(final WebElement element) {
try {
return !element.isDisplayed();
} catch (StaleElementReferenceException ignored) {
} catch (StaleElementReferenceException | NoSuchElementException ignored) {
// We can assume a stale element isn't displayed.
return true;
}
Expand Down

0 comments on commit 624731c

Please sign in to comment.