Protractor 在量角器中上载外部文件
我试图上传一个远程文件通过窗口弹出使用量角器,但没有任何解决方案的工作 请某人帮忙 我的代码类似于:- var remote=require('F:/untitled/node_modules/selenium webdriver/remote'); browser.setFileDetector(新的remote.FileDetector()) 源代码类似于 文件不可删除 可获得的Protractor 在量角器中上载外部文件,protractor,Protractor,我试图上传一个远程文件通过窗口弹出使用量角器,但没有任何解决方案的工作 请某人帮忙 我的代码类似于:- var remote=require('F:/untitled/node_modules/selenium webdriver/remote'); browser.setFileDetector(新的remote.FileDetector()) 源代码类似于 文件不可删除 可获得的 添加附件 您好,也许您应该发布您已经尝试过的一些特定示例以及您看到的任何错误。请在运行测试时发布代码、h
添加附件
您好,也许您应该发布您已经尝试过的一些特定示例以及您看到的任何错误。请在运行测试时发布代码、html和错误(如果有)。我在单击按钮后打开的窗口中没有看到错误,但什么都没有。请有人帮助,我仍然卡在那里
var fileElem = element(by.css('input[type="file"]'));
//files
//var fileElem = element(by.css('div.file-uploader'));
var absolutePath = 'F:/1778.docx';
browser.switchTo().activeElement();
browser.executeScript("arguments[0].style.visibility = 'visible'; arguments[0].style.height = '1px'; arguments[0].style.width = '1px';arguments[0].style.opacity = 1", fileElem.getWebElement());
fileElem.sendKeys(absolutePath);
browser.driver.sleep(100);*/
<div ng-show="dropAvailable" ng-switch="buttonType" layout="row" layout-align="center center" class="">
<!-- ngSwitchWhen: fab -->
<!-- ngSwitchWhen: icon -->
<!-- ngSwitchWhen: text-icon --><div class="file-upload-button ng-scope" ng-switch-when="text-icon">
<button class="btn btn-primary ng-binding" aria-label="Add Attachment">Add Attachment <span ng-class="icon" class="glyphicon glyphicon-paperclip"></span></button>
</div>
<!-- ngSwitchDefault: -->
</div>
</div><!-- end ngIf: canUploadFn() -->
<!-- Display the existing files -->
<!-- ngIf: showAttachments -->