Part Request submitter: attach files one at a time so multiple attachments (schlib+pcblib+datasheet) accumulate reliably

main
admin 2026-07-15 07:36:45 +00:00
parent 1b906dc51a
commit c74c9d8e22
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

Binary file not shown.

View File

@ -112,13 +112,13 @@ def _add_parameters(driver, params):
def _attach_files(driver, files): def _attach_files(driver, files):
files = [f for f in (files or []) if f and os.path.exists(f)] present = [f for f in (files or []) if f and os.path.exists(f)]
if not files: missing = [f for f in (files or []) if f and not os.path.exists(f)]
return [], [f for f in (files or []) if f and not os.path.exists(f)] for f in present: # one at a time so multiple files accumulate
inp = _wait(driver, EC.presence_of_element_located((By.ID, "fileupload"))) inp = _wait(driver, EC.presence_of_element_located((By.ID, "fileupload")))
inp.send_keys("\n".join(os.path.abspath(f) for f in files)) # multi-file input inp.send_keys(os.path.abspath(f))
time.sleep(1.0) time.sleep(0.8)
return files, [] return present, missing
def submit_request(driver, base, req, no_submit=False): def submit_request(driver, base, req, no_submit=False):