From b29af2efc69bf541d8630162d1cc15c811c9b9af Mon Sep 17 00:00:00 2001 From: Aniket Singh Rawat Date: Tue, 12 Mar 2024 11:53:36 +0000 Subject: [PATCH 1/3] supressed chained find command errors --- lib/api/web-element/scoped-element.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/api/web-element/scoped-element.js b/lib/api/web-element/scoped-element.js index 69cd42123f..fcf4da3ea1 100644 --- a/lib/api/web-element/scoped-element.js +++ b/lib/api/web-element/scoped-element.js @@ -159,6 +159,16 @@ class ScopedWebElement { const parentElement = args[0]; + // Check if parentElement is valid or not. + if (parentElement && parentElement.webElement){ + const parent = await parentElement.webElement; + if (parent === null){ + // The parent was of type WebElement but was not resolved. + // Supress further errors from find element commands. + suppressNotFoundErrors = true; + } + } + try { if (condition.usingRecursion) { return await this.findElementUsingRecursion({parentElement, recursiveElement: condition, timeout, retryInterval}); From 76eafd9ade2a1f737431bbbc435d450c0c74c6c5 Mon Sep 17 00:00:00 2001 From: Aniket Singh Rawat Date: Tue, 12 Mar 2024 11:57:04 +0000 Subject: [PATCH 2/3] nits --- lib/api/web-element/scoped-element.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api/web-element/scoped-element.js b/lib/api/web-element/scoped-element.js index fcf4da3ea1..52ac03e4eb 100644 --- a/lib/api/web-element/scoped-element.js +++ b/lib/api/web-element/scoped-element.js @@ -160,9 +160,9 @@ class ScopedWebElement { const parentElement = args[0]; // Check if parentElement is valid or not. - if (parentElement && parentElement.webElement){ + if (parentElement && parentElement.webElement) { const parent = await parentElement.webElement; - if (parent === null){ + if (parent === null) { // The parent was of type WebElement but was not resolved. // Supress further errors from find element commands. suppressNotFoundErrors = true; From 7e1934658c25744986d4a6e47acd231cbd83410c Mon Sep 17 00:00:00 2001 From: Aniket Singh Rawat Date: Thu, 1 Aug 2024 08:49:28 +0530 Subject: [PATCH 3/3] fixes --- lib/api/web-element/scoped-element.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/api/web-element/scoped-element.js b/lib/api/web-element/scoped-element.js index 52ac03e4eb..b2da05f232 100644 --- a/lib/api/web-element/scoped-element.js +++ b/lib/api/web-element/scoped-element.js @@ -159,14 +159,8 @@ class ScopedWebElement { const parentElement = args[0]; - // Check if parentElement is valid or not. - if (parentElement && parentElement.webElement) { - const parent = await parentElement.webElement; - if (parent === null) { - // The parent was of type WebElement but was not resolved. - // Supress further errors from find element commands. - suppressNotFoundErrors = true; - } + if (parentElement?.webElement && await parentElement.webElement === null) { + return null; } try {