Description
It is apparently the case that a range of “modern” JS frameworks hides <input type=file>
and provides indirection for selecting files via alternate UX elements. When using Element Send Keys to upload files to the file upload element WebDriver will typically complain that the element is not interactable, because the JS framework will have hidden the element from view (display: none
).
I have not yet received a reproducible test case for this, so it’s unclear to me if it is possible to write automation code to interact witht he UX element to indirectly set the file on the file upload element or not. If it is true that this is impossible, we should consider how we can make it possible to use Element Send Keys to upload files when the file upload element is hidden from view.
At the moment I can’t think of any better solutions that to special case <input type=file>
in the keyboard-interactability check so that we always treat it as interactable. This would enable users to upload files to non-displayed elements.
Can someone who is more JS-savvy confirm how file upload control indirection works in practice?
See also: