调用元素方法时 Proptractor 错误
Proptractor error when call element methods
我所有的行为,只是:
element(by.binding('item.order.id')).click();
在此代码区:
<tr
ng-repeat="item in dataList.content"
ng-class="{'colored-order': (settingsStorage.getProperty('personal', 'coloredOrders') === true || settingsStorage.getProperty('personal', 'coloredOrders') === 'true')}"
class="{{item.order.status}}"
>
<td>
<a
href="{{contextPath}}/company/view/{{item.ownerId}}/"
target="_blank"
>
<strong
class="mL20"
ng-if="search.viewType === 'ARRIVED'"
ng-cloak
>
{{item.order.billTo.name}}
</strong>
</a>
<strong
class="mL20"
ng-if="search.viewType !== 'ARRIVED'"
ng-cloak
>
{{item.order.billTo.name}}
</strong>
</td>
<td>
<a
ui-sref="vieworder({ orderId: item.order.id })"
class="link_to_view_order"
analytics-event
analytics-category-attr="Order_View"
>
{{item.order.id}}
</a>
</td>
</tr>
Message:
Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular
While waiting for element with locator - Locator: by.binding("item.order.id").
The following tasks were pending:
- $timeout: function () {
delete $rootScope.pagesCache.pages[data.page];
if ($state.current.name == data.page) {
$rootScope.$broadcast('update:data:' + data.page, { page: data.page });
}
}
但是当我尝试打印来控制这个元素时,它被打印出来了,没有问题。
可能与问题中回答的问题相同 -
通常这些问题的根本原因是当站点连续轮询 $timeout 或 $http 时,Protractor 将无限期地等待并超时。
关于为什么您会看到此错误的更多详细信息是 documented here。我已经在
的其他答案中详细解释了以下选项
忽略同步:勾选here
尝试不同的超时配置,看看您的应用轮询是否在一段时间后停止
allScriptsTimeout: 120000,
getPageTimeout: 120000,
jasmineNodeOpts: {
defaultTimeoutInterval: 120000
}
我所有的行为,只是:
element(by.binding('item.order.id')).click();
在此代码区:
<tr
ng-repeat="item in dataList.content"
ng-class="{'colored-order': (settingsStorage.getProperty('personal', 'coloredOrders') === true || settingsStorage.getProperty('personal', 'coloredOrders') === 'true')}"
class="{{item.order.status}}"
>
<td>
<a
href="{{contextPath}}/company/view/{{item.ownerId}}/"
target="_blank"
>
<strong
class="mL20"
ng-if="search.viewType === 'ARRIVED'"
ng-cloak
>
{{item.order.billTo.name}}
</strong>
</a>
<strong
class="mL20"
ng-if="search.viewType !== 'ARRIVED'"
ng-cloak
>
{{item.order.billTo.name}}
</strong>
</td>
<td>
<a
ui-sref="vieworder({ orderId: item.order.id })"
class="link_to_view_order"
analytics-event
analytics-category-attr="Order_View"
>
{{item.order.id}}
</a>
</td>
</tr>
Message: Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular While waiting for element with locator - Locator: by.binding("item.order.id"). The following tasks were pending: - $timeout: function () { delete $rootScope.pagesCache.pages[data.page]; if ($state.current.name == data.page) { $rootScope.$broadcast('update:data:' + data.page, { page: data.page }); } }
但是当我尝试打印来控制这个元素时,它被打印出来了,没有问题。
可能与问题中回答的问题相同 -
通常这些问题的根本原因是当站点连续轮询 $timeout 或 $http 时,Protractor 将无限期地等待并超时。
关于为什么您会看到此错误的更多详细信息是 documented here。我已经在
的其他答案中详细解释了以下选项忽略同步:勾选here
尝试不同的超时配置,看看您的应用轮询是否在一段时间后停止
allScriptsTimeout: 120000,
getPageTimeout: 120000,
jasmineNodeOpts: {
defaultTimeoutInterval: 120000
}