量角器找不到转发器

时间:2016-06-08 11:39:22

标签: javascript selenium protractor

我有情况。当我点击"更新"我的网络应用程序上的按钮 - 显示成功消息的警报。但是量角器找不到它。代码html:

<div class="toast ng-scope toast-success" ng-mouseout="restartTimer(toaster)" ng-mouseover="stopTimer(toaster)" ng-click="click(toaster)" ng-class="toaster.type" ng-repeat="toaster in toasters" style="">
<!-- ngIf: toaster.showCloseButton -->
<div class="ng-binding toast-title" ng-class="config.title"/>
<div class="toast-message" on="toaster.bodyOutputType" ng-switch="" ng-class="config.message">
<!-- ngSwitchWhen: trustedHtml -->
<!-- ngSwitchWhen: template -->
<!-- ngSwitchWhen: templateWithData -->
<!-- ngSwitchWhen: directive -->
<!-- ngSwitchDefault: -->
<div class="ng-binding ng-scope" ng-switch-default="">The application record has been successfully updated</div>
<!-- end ngSwitchWhen: -->
</div>
</div>
<!-- end ngRepeat: toaster in toasters -->
</div>

所以,量角器找不到它:

<div class="ng-binding ng-scope" ng-switch-default="">The application record has been successfully updated</div>

什么问题?

我使用那个定位器

element.all(by.repeater('toaster in toasters'))

1 个答案:

答案 0 :(得分:0)

  1. 在脚本中使用ExpectedConditions,它会阻止Protractor在实际出现在页面之前查找警报。如果未解决,请转到选项
  2. 尝试更新并降级烤面包机版本。它会起作用。