Open randall-coding opened 2 years ago
This issue was addressed on playwright recently, this pull request adds that functionality https://github.com/microsoft/playwright/pull/12937.
But before we can use it in rust, the rust bindings code will need to be updated similarly as they did for java
I see that for other languages using playwright it is possible to just provide an element and a filepath to perform file upload https://stackoverflow.com/questions/66132097/playwright-upload-files-from-non-input-element-that-cannot-be-used-page-setinpu
But looking at the source for playwright-rust it appears that I need a File struct which consists of
https://docs.rs/playwright/0.0.19/playwright/api/struct.File.html https://docs.rs/playwright/0.0.19/playwright/api/element_handle/struct.ElementHandle.html#method.set_input_files_builder
Is there any way I can call this like those other examples using just the filepath instead of having to provide buffer and mime type?
If I do have to provide buffer can you point me in the right direction of how to produce that in the correct format?
My current test code looks like this:
Though for some reason respite setting the mime type I still get the following error: