wallaby icon indicating copy to clipboard operation
wallaby copied to clipboard

multiple file upload

Open cysiegel opened this issue 5 years ago • 2 comments

Thank you again for this great library

Currently the attach_file/3 only allows the uploading of one file at a time
Is it possible to add the ability to upload multiple files at once

Thanks

cysiegel avatar Aug 25 '20 08:08 cysiegel

Hi! Which backend (chromedriver, selenium) are you using? And if you're using selenium, which browser?

Based on this stackoverflow question, and current wallaby attach_file/3 implementation, I think you might be able to attach multiple files this way for Chrome:

session
|> set_value(file_input_query, Enum.join([absolute_path1, absolute_path2], " \n "))

michallepicki avatar Aug 28 '20 16:08 michallepicki

There is actually a bug in the attach_file function. The function receives a list of tuples with the path of the files to be uploaded. However, it is not possible to send a list with more than one item.

image

The michallepicki solution works.

Thanks

alexandreguz avatar Oct 27 '20 15:10 alexandreguz