webdriver.dart icon indicating copy to clipboard operation
webdriver.dart copied to clipboard

Unable to upload files to remote WebDrivers

Open tylersnavely-wf opened this issue 9 years ago • 3 comments

We are not able to upload files on file input elements on remote services like Sauce Labs. This is normally done by sending keys to the element. The Dart client doesn't appear to upload the file to remote services first like the others do. Python Example

If the keys being sent to an element are found to be a path that points to a local file, the file is upload to the WebDriver with a POST request to /session/$sessionId/file, and the response to that request is what's actually sent to the element.

  • Dart version: 1.9.0-dev.8.0
  • OS: OS X 10.10.3
  • Dart webdriver version: 0.9.1

tylersnavely-wf avatar Jun 18 '15 16:06 tylersnavely-wf

+1

raphaeladam-wf avatar Jun 18 '15 16:06 raphaeladam-wf

I actually really hate how the Selenium clients overload sendKeys for this.

What I would prefer is that a WebElement.uploadFile(File file) method is added that uploads the file and sends the appropriate keys to the element. The code for such a method is not that complicated, except that Selenium is expecting the sent file to be a zip file, and last time I looked there wasn't a zip file library for Dart.

DrMarcII avatar Sep 01 '15 07:09 DrMarcII

last time I looked there wasn't a zip file library for Dart.

I've not used it, but it looks to have a ZIP encoder: https://github.com/brendan-duncan/archive

tylersnavely-wf avatar Nov 02 '15 15:11 tylersnavely-wf