2015-09-14 36 views
-2

如何使用量角器自動化文件上傳功能?使用量角器自動化文件上傳功能

+0

請註明你的問題。什麼是您需要的系統窗口和文件? – Salasar

+1

[如何在angularjs e2e量角器測試中上傳文件]的可能重複(http://stackoverflow.com/questions/21305298/how-to-upload-file-in-angularjs-e2e-protractor-testing) – alecxe

回答

0

我相信你問的是如何上傳文件到你的應用程序,是否正確?如果是此代碼的工作:

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);