diff --git a/t/selenium/functions/Collections.py b/t/selenium/functions/Collections.py index da155a8d6d..e92363a0f8 100644 --- a/t/selenium/functions/Collections.py +++ b/t/selenium/functions/Collections.py @@ -12,7 +12,14 @@ from functions.Functions import wait_for_invisibility def login_panel(driver, username="administrator", password="administrator"): driver.get(os.environ['CATALYST_SERVER'] + ":1443") - driver.find_element_by_xpath('//*[@id="login_page_v1"]/div[3]/div/b/a').click() + try: + driver.implicitly_wait(1) + driver.find_element_by_xpath('//*[@id="login_page_v1"]//div/b/a').click() + driver.implicitly_wait(10) + except: + pass + finally: + driver.implicitly_wait(10) WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@aria-label="Username"]'))) fill_element(driver, '//*[@aria-label="Username"]', username) fill_element(driver, '//*[@aria-label="Password"]', password) diff --git a/t/selenium/testrun.py b/t/selenium/testrun.py index 545f3a498e..1ee4a2db8e 100644 --- a/t/selenium/testrun.py +++ b/t/selenium/testrun.py @@ -676,7 +676,14 @@ class testrun(unittest.TestCase): filename = "test_login_page.png" driver = self.driver driver.get(os.environ['CATALYST_SERVER'] + ":1443") - driver.find_element_by_xpath('//*[@id="login_page_v1"]/div[3]/div/b/a').click() + try: + driver.implicitly_wait(1) + driver.find_element_by_xpath('//*[@id="login_page_v1"]//div/b/a').click() + driver.implicitly_wait(10) + except: + pass + finally: + driver.implicitly_wait(10) print("\nTry to login with no credentials...", end="") WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div//main/div/form//button[contains(., "Sign In")]'))) click_js(driver, '//*[@id="q-app"]/div//main/div/form//button[contains(., "Sign In")]')