From b974b3dfc1e332a73568d3160c34431ebf18984a Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 11 Oct 2024 15:36:11 +0100 Subject: [PATCH] bitbake: toaster/tests/selenium_helper_base: Handle WebDriverException The WebDriverException can occur if elements are not present in the DOM yet. Catch and handle this. It is our most frequently occuring failure in automated testing now. (Bitbake rev: 006173cbd32116ff1cea59b2c99eead807be39bb) Signed-off-by: Richard Purdie --- bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py index 393be75496..22d4085b24 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py @@ -27,7 +27,7 @@ from selenium.webdriver.common.by import By from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.common.exceptions import NoSuchElementException, \ StaleElementReferenceException, TimeoutException, \ - SessionNotCreatedException + SessionNotCreatedException, WebDriverException def create_selenium_driver(cls,browser='chrome'): # set default browser string based on env (if available) @@ -114,6 +114,9 @@ class Wait(WebDriverWait): pass except StaleElementReferenceException: pass + except WebDriverException: + # selenium.common.exceptions.WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"} + pass time.sleep(self._poll) if time.time() > end_time: