From af62bf151eff3d84608f9fcb9621ed1128b29a7e Mon Sep 17 00:00:00 2001 From: Gitead Date: Mon, 14 Sep 2026 23:38:06 -0400 Subject: [PATCH] fix: poll longer for Status & History table to load in preauth worker Status & History page loads results asynchronously; a single 20s wait was giving up before the row appeared, so the pre-auth number was never captured. Now polls up to 75s for a populated row. Co-Authored-By: Claude Sonnet 5 --- .../selenium_UnitedDH_preAuthWorker.py | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) 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