diff --git a/lib/api/web-element/scoped-element.js b/lib/api/web-element/scoped-element.js index 8dffc0b8f..91a17d894 100644 --- a/lib/api/web-element/scoped-element.js +++ b/lib/api/web-element/scoped-element.js @@ -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; }