添加untrackOutstandingTimeouts后的超时错误:在量角器conf中为true

时间:2016-03-02 14:12:50

标签: angularjs gruntjs timeout protractor

我的量角器conf看起来像这样:

    exports.config = {
    seleniumServerJar: "../node_modules/protractor/selenium/selenium-server-standalone-2.51.0.jar",
    seleniumPort: 4444,
    baseUrl: baseUrl,
    specs: specs,
    untrackOutstandingTimeouts:true,
    jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 3600000
  },

  framework: "jasmine2"
}

我正在尝试对角度页面执行操作,但失败并出现错误 -

Failed: Timed out waiting for Protractor to synchronize with the page after 150 seconds. 
Please see https://github.com/angular/protractor/blob/master/docs/faq.md. 
The following tasks were pending:
- $http: /api/v1/query/tail/242ac110002-8/1h?t=1456925874600

我在量角器conf中添加了 untrackOutstandingTimeouts:true ,但我仍然遇到错误。

Protractor Version - 3.1.1
Node version - 4.3.1
Selenium-webdriver - 2.51.0

提前致谢!

1 个答案:

答案 0 :(得分:1)

能够使用browser.ignoreSynchronization

解决上述问题
browser.get('/');
browser.ignoreSynchronization=true;

//Go to page where $http  and $timeout is added
//Perform any action, steps here

browser.sleep(5000); //This can be replace with wait condition

browser.ignoresynchronization=false