fix: select Treatment Location by ID click like Billing Entity in UnitedDH claim step1
Replaces arrow-wrapper click (which hit the "Type to search" placeholder) with find_element(By.ID, "treatmentLocation") + click, mirroring the paymentGroupId approach. Looks for "Summit Dental Care" first, falls back to first available option. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -585,22 +585,34 @@ class AutomationUnitedDHClaimSubmit:
|
|||||||
print("[UnitedDH Claim] step1: Selecting Treatment Location...")
|
print("[UnitedDH Claim] step1: Selecting Treatment Location...")
|
||||||
location_selected = False
|
location_selected = False
|
||||||
try:
|
try:
|
||||||
location_ng = WebDriverWait(self.driver, 10).until(
|
location_input = self.driver.find_element(By.ID, "treatmentLocation")
|
||||||
EC.element_to_be_clickable((By.XPATH,
|
if location_input.is_displayed():
|
||||||
"//label[@for='treatmentLocation']/following-sibling::ng-select | "
|
self.driver.execute_script("arguments[0].scrollIntoView({block:'center'});", location_input)
|
||||||
"//label[@for='treatmentLocation']/..//ng-select"
|
location_input.click()
|
||||||
))
|
print("[UnitedDH Claim] step1: Clicked Treatment Location dropdown")
|
||||||
)
|
time.sleep(1)
|
||||||
self.driver.execute_script("arguments[0].scrollIntoView({block:'center'});", location_ng)
|
try:
|
||||||
arrow = location_ng.find_element(By.CSS_SELECTOR, ".ng-arrow-wrapper")
|
summit_option = WebDriverWait(self.driver, 5).until(
|
||||||
arrow.click()
|
EC.element_to_be_clickable((By.XPATH,
|
||||||
first_option = WebDriverWait(self.driver, 5).until(
|
"//ng-dropdown-panel//div[contains(@class,'ng-option') and contains(.,'Summit Dental Care')]"
|
||||||
EC.element_to_be_clickable((By.CSS_SELECTOR, ".ng-dropdown-panel .ng-option"))
|
))
|
||||||
)
|
)
|
||||||
option_text = first_option.text.strip()
|
summit_option.click()
|
||||||
first_option.click()
|
print("[UnitedDH Claim] step1: Selected Treatment Location: Summit Dental Care")
|
||||||
print(f"[UnitedDH Claim] step1: Selected Treatment Location: {option_text}")
|
location_selected = True
|
||||||
location_selected = True
|
except TimeoutException:
|
||||||
|
try:
|
||||||
|
first_option = self.driver.find_element(By.XPATH,
|
||||||
|
"//ng-dropdown-panel//div[contains(@class,'ng-option')]"
|
||||||
|
)
|
||||||
|
option_text = first_option.text.strip()
|
||||||
|
first_option.click()
|
||||||
|
print(f"[UnitedDH Claim] step1: Selected Treatment Location (fallback): {option_text}")
|
||||||
|
location_selected = True
|
||||||
|
except Exception:
|
||||||
|
print("[UnitedDH Claim] step1: No options available in Treatment Location dropdown")
|
||||||
|
ActionChains(self.driver).send_keys(Keys.ESCAPE).perform()
|
||||||
|
time.sleep(1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[UnitedDH Claim] step1: Treatment Location selection failed: {e}")
|
print(f"[UnitedDH Claim] step1: Treatment Location selection failed: {e}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user