From 9be6e8d93533425bb86056a65d3d1c963e924097 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 2 Feb 2022 10:48:40 +0100 Subject: [PATCH] exception handling and increased implicit wait (install_console) --- tests/install_console.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/install_console.py b/tests/install_console.py index a109436024..a9310541fb 100755 --- a/tests/install_console.py +++ b/tests/install_console.py @@ -3,6 +3,7 @@ import os from pyvirtualdisplay import Display from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException # Are we running headless? if ('DISPLAY' not in os.environ): @@ -27,14 +28,15 @@ try: browser.find_element_by_xpath("//*[@id='step4']").click() # Complete the installation. - browser.implicitly_wait(300) # The installation is going to take a long time. + browser.implicitly_wait(900) # The installation is going to take a long time. browser.find_element_by_xpath("//*[@id='step5']").click() browser.implicitly_wait(5) assert("Installation complete" in browser.page_source) browser.find_element_by_name("rn_file").click() except AssertionError as error: print("Error " + str(error) + ":\n" + browser.page_source) - +except NoSuchElementException as error: + print("Error " + str(error) + ":\n" + browser.page_source) # Clean-up browser.quit()