webdriver
webdriver copied to clipboard
Add command for file uploads (separate out from Element Send Keys)
This is a request which came up during discussions on issue #1230. Especially due to broken behavior of drivers when it comes to hidden file upload input elements.
As agreed during TPAC (minutes) the proposal from @andreastt should be implemented. For details see https://github.com/w3c/webdriver/issues/1230#issuecomment-376989364
@burg had a request over in https://github.com/w3c/webdriver/issues/1268 about adding a duplicate file check to Element Send Keys. @whimboo asked if we wanted to still add that to Element Send Keys, and I suspect the answer is that we don’t.
But adding a check for duplicate files to the new file upload command seems like a unanimously good idea, whilst also not breaking any backwards compatibility with Element Send Keys.
We can have this two ways:
-
Return an error when the remote end discovers two of the files have identical paths.
-
Deduplicate duplicate path entries.
Quick question. Is this about adding a new /session/{id}/file endpoint to be able to attach files in remote WebDriver sessions? Like what ChromeDriver supports for this non-W3C endpoint.
Imagine the WebDriver client is running in host A and the server in host B. Making the browser in host B upload a file (as in <input type="file">) that is in host A is quite cumbersome without the file endpoint.
Should I open a different issue for such a request?
Thanks.
https://github.com/w3c/webdriver-bidi/pull/514 added this to WebDriver BiDi.