【发布时间】:2015-11-12 20:20:28
【问题描述】:
我正在尝试单击页面上的上传文件链接,但我说上传链接不可见。我试过将鼠标悬停在链接和下面的代码上。这对我来说很容易解决,所以我真的很困惑如何去点击这个链接。 我试过的:
var EC = protractor.ExpectedConditions;
var uploadLink = element(by.model('roomPlanCtrl.mm2010File'));
browser.wait(EC.elementToBeClickable(uploadLink), 10000);
uploadLink.click();
HTML:
<span class="dg-link ng-untouched ng-valid ng-dirty ng-valid-parse" ngf-select="" ng-model="roomPlanCtrl.mm2010File" accept=".mms" ng-hide="roomPlanCtrl.hideImportLinks">Upload a MeetingMatrix 2010 File</span>
【问题讨论】:
-
您确定没有其他带有
ng-show="roomPlanCtrl.showImport2010Ctrls()"的元素吗?您是否也尝试过最大化浏览器窗口? -
您也可以尝试等到元素可见后再单击它吗?可能用点击功能链接等待会有所帮助。
-
@Alecxe 我在修复时上传了错误的 .html 和测试代码一秒钟。真的很抱歉。
-
@alecxe 更新代码,对不起,我搞砸了。
-
@Girish 我更新了我有错误 html 的代码并在那里测试代码
标签: javascript angularjs selenium automation protractor