webdriver icon indicating copy to clipboard operation
webdriver copied to clipboard

Add command for file uploads (separate out from Element Send Keys)

Open whimboo opened this issue 7 years ago • 3 comments

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

whimboo avatar Nov 07 '18 13:11 whimboo

@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:

  1. Return an error when the remote end discovers two of the files have identical paths.

  2. Deduplicate duplicate path entries.

andreastt avatar Nov 07 '18 13:11 andreastt

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.

etanol avatar Mar 15 '19 11:03 etanol

https://github.com/w3c/webdriver-bidi/pull/514 added this to WebDriver BiDi.

gsnedders avatar Jun 05 '25 08:06 gsnedders