Reputation: 73
I'm able to upload file using below code
var fileToUpload = 'tt.jpg';
var absolutePath = path.resolve(__dirname, fileToUpload);
var FileDetector = require('selenium-webdriver/remote/index.js').FileDetector;
browser.setFileDetector(new FileDetector());
element(by.css('input[type="file"]')).sendKeys(absolutePath);`
But file will upload with zero byte size even though file size is actually 1 KB Fileupload successfully but with 0 size bytes here
My development added below code for uploading the file Dev Code
Upvotes: 0
Views: 59