How to automate file uploading functionality using protractor?
Asked
Active
Viewed 140 times
-2
-
Please specify you question. What are system window and files you need? – Salasar Sep 14 '15 at 07:32
-
1possible duplicate of [How to upload file in angularjs e2e protractor testing](http://stackoverflow.com/questions/21305298/how-to-upload-file-in-angularjs-e2e-protractor-testing) – alecxe Sep 14 '15 at 13:04
1 Answers
0
I believe you are asking how to upload a file to your app, correct? if so this code works:
var path = require('path');
//the file to upload
var fileToUpload = 'C:\\your file path',
//this is variable that inserts the path to find file to upload
absolutePath = path.resolve(__dirname, fileToUpload);
//inserts the path
$('input[type="file"]').sendKeys(absolutePath);

Nicole Phillips
- 753
- 1
- 18
- 41