I have a html element
<input type=file multiple="">
How can I use send_keys to upload multiple files?
Currently this works with uploading single file. I want to use this to upload multiple files
I tried Comma separated paths but no luck.
path = “/home/downloads/” send_keys(path + “file1.csv \n” + path + “file2.csv”)
I found it working in my code. Do try this and give me update on the error you got.
First, send all files to the element and then submit.
Following is Ruby code, but you can apply same logic for Python:
uploader = driver.find_element(id: 'file-upload')
uploader.send_keys 'path_to_file1'
uploader.send_keys 'path_to_file2'
uploader.send_keys 'path_to_file3'
.
.
.
uploader.submit
I'm not sure if this will work, but just give a try and let me know the result.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With