Skip to content

Commit

Permalink
FIXES nightwatchjs#4223: Suppress only NoSuchElementError in suppress…
Browse files Browse the repository at this point in the history
…NotFoundErrors
  • Loading branch information
Vaibhavsahu2810 committed Nov 8, 2024
1 parent 18feab0 commit bd0ba92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/api/web-element/scoped-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ class ScopedWebElement {

return await this.findElement({parentElement, selector: condition, index, timeout, retryInterval});
} catch (error) {
if (this.suppressNotFoundErrors) {
if (
this.suppressNotFoundErrors &&
error.name === 'NoSuchElementError'
) {
return null;
}

Expand Down

0 comments on commit bd0ba92

Please sign in to comment.