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?
Asked
Active
Viewed 2,610 times
0
-
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 Answers
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
- 14,131
- 7
- 65
- 79