如何使用量角器上传文件

时间:2018-07-03 12:26:54

标签: file-upload protractor

我正在尝试上传图像,当我单击“上传图像”按钮时,它会显示所有图像,但我无法选择图像。

这是HTML代码,请为我提出解决方案。

<div class="uploadimg clearfix" ng-show="member.data.imageType != 'avatar'">
   <div ng-model="member.data.image" name="image" ngf-select="uploadFiles($file, $invalidFiles,'user')" class="button ng-pristine ng-untouched ng-valid ng-empty">
      <img ng-src="/public/images/uploadimg-img.jpg" src="/public/images/uploadimg-img.jpg">
   </div>
   <div class="uploadingsecpop ng-hide" ng-show="member.data.image &amp;&amp; member.data.imageType == 'image'">
      <img class="thumb" src="/public/images/" alt="">
   </div>
</div>

enter image description here

1 个答案:

答案 0 :(得分:0)

var path = require('path');
var fileToUpload = "F://images/f2.jpg";
var absolutePath = path.resolve(__dirname, fileToUpload);
element(&%#LOCATOR&^#%).sendKeys(absolutePath);