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 <noreply@anthropic.com>
This commit is contained in:
@@ -640,9 +640,11 @@ class AutomationUnitedDHClaimSubmit:
|
|||||||
try:
|
try:
|
||||||
print("[UnitedDH Claim] step3: waiting for Practitioner & Location page")
|
print("[UnitedDH Claim] step3: waiting for Practitioner & Location page")
|
||||||
|
|
||||||
# Wait for the Billing Entity label to be visible — confirms page has fully rendered
|
# Wait for the Continue button — primary indicator that the page has loaded
|
||||||
WebDriverWait(self.driver, 20).until(
|
continue_btn = WebDriverWait(self.driver, 20).until(
|
||||||
EC.visibility_of_element_located((By.XPATH, "//label[@for='paymentGroupId']"))
|
EC.element_to_be_clickable((By.XPATH,
|
||||||
|
"//button[contains(@class,'btn-primary') and contains(normalize-space(text()),'Continue')]"
|
||||||
|
))
|
||||||
)
|
)
|
||||||
|
|
||||||
# --- Treatment Location ---
|
# --- Treatment Location ---
|
||||||
@@ -701,7 +703,7 @@ class AutomationUnitedDHClaimSubmit:
|
|||||||
if not billing_selected:
|
if not billing_selected:
|
||||||
print("[UnitedDH Claim] step3: WARNING: Could not select Billing Entity — continuing anyway")
|
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(
|
continue_btn = WebDriverWait(self.driver, 10).until(
|
||||||
EC.element_to_be_clickable((By.XPATH,
|
EC.element_to_be_clickable((By.XPATH,
|
||||||
"//button[contains(@class,'btn-primary') and contains(normalize-space(text()),'Continue')]"
|
"//button[contains(@class,'btn-primary') and contains(normalize-space(text()),'Continue')]"
|
||||||
|
|||||||
Reference in New Issue
Block a user