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')]"