0

I want to write a script that fills out a form and uploads a file in cucumber-js,selenium,and protractor. whenever I click an upload file button though, there is no xpath/id/etc... to click on. How do you handle file uploads?

William Roberts
  • 319
  • 2
  • 4
  • 20
  • http://stackoverflow.com/questions/21305298/how-to-upload-file-in-angularjs-e2e-protractor-testing/21314337#21314337 – Andres D Feb 05 '15 at 21:22

1 Answers1

0

By the way uploading file has nothing to do with cucumberjs. Just send keys to input with type=file. Also make sure that file path is absolute. So a pure WebDriver code could be look like,

driver.findElement(wd.By.css('input[type=file]')).sendKeys('/absolute/path/to/my/file');
nilesh
  • 13,751
  • 6
  • 62
  • 77