summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-11 15:36:11 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-14 21:44:38 +0100
commitb974b3dfc1e332a73568d3160c34431ebf18984a (patch)
treebca8dbfd20873637816609bf447c2d53e4c76337 /bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
parent5b7f1f29b59d5cf7e19a4a9ef9fddc6b5d25a259 (diff)
downloadpoky-b974b3dfc1e332a73568d3160c34431ebf18984a.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/selenium_helpers_base.py')
-rw-r--r--bitbake/lib/toaster/tests/browser/selenium_helpers_base.py5
1 files changed, 4 insertions, 1 deletions
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
27from selenium.webdriver.common.desired_capabilities import DesiredCapabilities 27from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
28from selenium.common.exceptions import NoSuchElementException, \ 28from selenium.common.exceptions import NoSuchElementException, \
29 StaleElementReferenceException, TimeoutException, \ 29 StaleElementReferenceException, TimeoutException, \
30 SessionNotCreatedException 30 SessionNotCreatedException, WebDriverException
31 31
32def create_selenium_driver(cls,browser='chrome'): 32def create_selenium_driver(cls,browser='chrome'):
33 # set default browser string based on env (if available) 33 # set default browser string based on env (if available)
@@ -114,6 +114,9 @@ class Wait(WebDriverWait):
114 pass 114 pass
115 except StaleElementReferenceException: 115 except StaleElementReferenceException:
116 pass 116 pass
117 except WebDriverException:
118 # selenium.common.exceptions.WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
119 pass
117 120
118 time.sleep(self._poll) 121 time.sleep(self._poll)
119 if time.time() > end_time: 122 if time.time() > end_time: