selenium working well

This commit is contained in:
2025-06-04 19:07:13 +05:30
parent e21177edcd
commit c4cf6964a3
3 changed files with 12 additions and 15 deletions

View File

@@ -599,7 +599,7 @@ export function ClaimForm({
}
/>
<Input
placeholder="eg. MOD"
placeholder="eg. 'B', 'D', 'F', 'I', 'L', 'M', 'O'"
value={line.toothSurface}
onChange={(e) =>
updateServiceLine(i, "toothSurface", e.target.value)

View File

@@ -15,8 +15,6 @@ app.add_middleware(
@app.post("/run")
async def run_bot(request: Request):
data = await request.json()
print(data)
input("waiting")
try:
bot = AutomationMassDHP(data)
result = bot.main_workflow("https://providers.massdhp.com/providers_login.asp")

View File

@@ -201,13 +201,11 @@ class AutomationMassDHP:
# 2 - Upload PDFs:
try:
pdfs_abs = [proc for proc in self.pdfs]
with tempfile.TemporaryDirectory() as tmp_dir:
for pdf_obj in pdfs_abs:
base64_data = pdf_obj["buffer"]
base64_data = pdf_obj["bufferBase64"]
file_name = pdf_obj.get("originalname", "tempfile.pdf")
# Full path with original filename inside temp dir
@@ -232,7 +230,7 @@ class AutomationMassDHP:
# 3 - Indicate Missing Teeth Part
try:
# Handle the missing teeth section based on the status
missing_status = self.missingTeethStatus
missing_status = self.missingTeethStatus.strip() if self.missingTeethStatus else "No_missing"
if missing_status == "No_missing":
missing_teeth_no = wait.until(EC.presence_of_element_located((By.XPATH, "//input[@type='checkbox' and @name='PAU_Step3_Checkbox1']")))
@@ -265,15 +263,16 @@ class AutomationMassDHP:
# 4 - Update Remarks
try:
textarea = wait.until(EC.presence_of_element_located((By.XPATH, "//textarea[@name='Remarks']")))
textarea.clear()
textarea.send_keys(self.remarks)
if self.remarks.strip():
textarea = wait.until(EC.presence_of_element_located((By.XPATH, "//textarea[@name='Remarks']")))
textarea.clear()
textarea.send_keys(self.remarks)
# Wait for update button and click it
update_button = wait.until(EC.element_to_be_clickable((By.XPATH, "//input[@type='submit' and @value='Update Remarks']")))
update_button.click()
time.sleep(3)
# Wait for update button and click it
update_button = wait.until(EC.element_to_be_clickable((By.XPATH, "//input[@type='submit' and @value='Update Remarks']")))
update_button.click()
time.sleep(3)
except Exception as e:
print(f"Error while filling remarks: {e}")