Part Request submitter: attach files one at a time so multiple attachments (schlib+pcblib+datasheet) accumulate reliably
parent
1b906dc51a
commit
c74c9d8e22
Binary file not shown.
|
|
@ -112,13 +112,13 @@ def _add_parameters(driver, params):
|
|||
|
||||
|
||||
def _attach_files(driver, files):
|
||||
files = [f for f in (files or []) if f and os.path.exists(f)]
|
||||
if not files:
|
||||
return [], [f for f in (files or []) if f and not os.path.exists(f)]
|
||||
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
|
||||
time.sleep(1.0)
|
||||
return files, []
|
||||
present = [f for f in (files or []) if f and os.path.exists(f)]
|
||||
missing = [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.send_keys(os.path.abspath(f))
|
||||
time.sleep(0.8)
|
||||
return present, missing
|
||||
|
||||
|
||||
def submit_request(driver, base, req, no_submit=False):
|
||||
|
|
|
|||
Loading…
Reference in New Issue