diff --git a/tools/autotest.py b/tools/autotest.py index 2aead948..86320ebb 100755 --- a/tools/autotest.py +++ b/tools/autotest.py @@ -56,7 +56,13 @@ try: wait.until(expected_conditions.presence_of_element_located((By.ID, 'create_id'))).click() driver.switch_to.alert.accept() - id0 = wait.until(expected_conditions.presence_of_element_located((By.TAG_NAME, 'li'))).text.split(' ')[-1] + # StaleElementReferenceException + while True: + try: + id0 = wait.until(expected_conditions.presence_of_element_located((By.TAG_NAME, 'li'))).text.split(' ')[-1] + break + except: + pass wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//li/button[text()="Export Identity"]'))).click() driver.switch_to.default_content() wait.until(expected_conditions.presence_of_element_located((By.XPATH, '//button[text()="✅ Allow"]'))).click() @@ -115,7 +121,13 @@ try: wait.until(expected_conditions.presence_of_element_located((By.ID, 'content'))) - driver.find_element(By.TAG_NAME, 'tf-navigation').shadow_root.find_element(By.LINK_TEXT, 'logout testuser').click() + # NoSuchElementException + while True: + try: + driver.find_element(By.TAG_NAME, 'tf-navigation').shadow_root.find_element(By.LINK_TEXT, 'logout testuser').click() + break + except: + pass driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'guest_label').click() driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'guestButton').click()