diff --git a/apps/SeleniumService/selenium_UnitedDH_preAuthWorker.py b/apps/SeleniumService/selenium_UnitedDH_preAuthWorker.py index 76e40f73..63e141ea 100644 --- a/apps/SeleniumService/selenium_UnitedDH_preAuthWorker.py +++ b/apps/SeleniumService/selenium_UnitedDH_preAuthWorker.py @@ -1139,14 +1139,24 @@ class AutomationUnitedDHPreAuth: time.sleep(3) print(f"[UnitedDH PreAuth] step9: Status & History URL: {self.driver.current_url}") - # Wait for table rows with actual data (not just headers) - try: - WebDriverWait(self.driver, 20).until( - EC.presence_of_element_located((By.XPATH, "//table//tr[td]")) - ) + # Wait for table rows with actual data (not just headers). The list loads + # asynchronously and can take a while to populate, so poll for a good + # while (up to ~75s total) instead of giving up after one short wait. + row_deadline = time.time() + 75 + found_rows = False + while time.time() < row_deadline: + try: + rows = self.driver.find_elements(By.XPATH, "//table//tr[td]") + if rows and any(r.text.strip() for r in rows): + found_rows = True + break + except Exception: + pass + time.sleep(3) + if found_rows: time.sleep(2) - except Exception: - print("[UnitedDH PreAuth] step9: Table rows did not appear — proceeding with body scan") + else: + print("[UnitedDH PreAuth] step9: Table rows did not appear after 75s — proceeding with body scan") preauth_number = None