加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 错误超时等待Protractor在11秒后与页面同步

发布时间:2020-12-17 06:56:26 所属栏目:安全 来源:网络整理
导读:我的量角器测试有问题.我的角应用程序使用$timeout来连续从服务器轮询某些内容.不幸的是,当我运行我的测试时,这会导致以下错误消息: There was a webdriver error: Error Timed out waiting for Protractor to synchronize with the page after 11 seconds.
我的量角器测试有问题.我的角应用程序使用$timeout来连续从服务器轮询某些内容.不幸的是,当我运行我的测试时,这会导致以下错误消息:

There was a webdriver error: Error Timed out waiting for Protractor to synchronize with the page after 11 seconds. Please see https://github.com/angular/protrac
tor/blob/master/docs/faq.md

如何处理这种持续的轮询超时?在我的情况下将browser.ignoreSynchronization设置为false不是一个好的解决方案(当我这样做时,我必须插入很多browser.sleep())

在我的应用程序中,目前无法按照建议here从$timeout切换到$interval.增加超时也是不可能的(正如我所说,服务不断从服务器轮询某些内容)

是否有可能更改waitForAngular例程,以便我的测试不会超时?

任何帮助将受到高度赞赏.

解决方法

从 protractor’s documentation开始:

Before performing any action,Protractor asks Angular to wait until the page is synchronized. This means that all timeouts and http requests are finished. If your application continuously polls $timeout or $http,it will never be registered as completely loaded. You should use the $interval service (07001) for anything that polls continuously (introduced in Angular 1.2rc3).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读