From cda00f5f8a753b31f120a1528ac75dec83023ecc Mon Sep 17 00:00:00 2001 From: ff Date: Fri, 29 May 2026 22:26:21 -0400 Subject: [PATCH] fix: restore Continue button as page indicator in claim step3 to prevent browser close Using paymentGroupId label as the page-load wait caused TimeoutException when the claim flow's page structure differed, returning ERROR and triggering _minimize_browser (about:blank + minimize). Now waits for the btn-primary Continue button (original safe indicator) and wraps both dropdown selections in try/except so the step never fails due to a missed dropdown. Co-Authored-By: Claude Sonnet 4.6 --- .../selenium_UnitedDH_claimSubmitWorker.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/SeleniumService/selenium_UnitedDH_claimSubmitWorker.py b/apps/SeleniumService/selenium_UnitedDH_claimSubmitWorker.py index 0c853232..05b7d44b 100644 --- a/apps/SeleniumService/selenium_UnitedDH_claimSubmitWorker.py +++ b/apps/SeleniumService/selenium_UnitedDH_claimSubmitWorker.py @@ -640,9 +640,11 @@ class AutomationUnitedDHClaimSubmit: try: print("[UnitedDH Claim] step3: waiting for Practitioner & Location page") - # Wait for the Billing Entity label to be visible — confirms page has fully rendered - WebDriverWait(self.driver, 20).until( - EC.visibility_of_element_located((By.XPATH, "//label[@for='paymentGroupId']")) + # Wait for the Continue button — primary indicator that the page has loaded + continue_btn = WebDriverWait(self.driver, 20).until( + EC.element_to_be_clickable((By.XPATH, + "//button[contains(@class,'btn-primary') and contains(normalize-space(text()),'Continue')]" + )) ) # --- Treatment Location --- @@ -701,7 +703,7 @@ class AutomationUnitedDHClaimSubmit: if not billing_selected: print("[UnitedDH Claim] step3: WARNING: Could not select Billing Entity — continuing anyway") - # Re-find Continue button after selections to avoid stale element reference + # Re-find Continue button after dropdown interactions to avoid stale element reference continue_btn = WebDriverWait(self.driver, 10).until( EC.element_to_be_clickable((By.XPATH, "//button[contains(@class,'btn-primary') and contains(normalize-space(text()),'Continue')]"