【问题标题】:Protractor error on Angular page testing: A Jasmine spec timed out. Resetting the WebDriver Control FlowAngular 页面测试中的量角器错误:Jasmine 规范超时。重置 WebDriver 控制流
【发布时间】:2018-08-17 23:08:36
【问题描述】:

当我在规范中使用 browser.get 时,出现此错误

ScriptTimeoutError: 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(css 
selector, [class="loading ng-scope ng-isolate-scope"]).`

Webdriver是最新版本

  • 我必须在我的规范中使用角度元素,但我试图改变 browser.ignoreSynchronizationbrowser.get(link) 之前变为true 并在获取页面后更改为false。没有改变。我还尝试使用browser.driver.get(link) 而不是browser.get(link)。增加 allScriptsTimeout: 110000, getPageTimeout: 110000, defaultTimeoutInterval: 600000

我应该怎么做才能避免出现这个错误?

【问题讨论】:

    标签: angular jasmine protractor automated-tests e2e-testing


    【解决方案1】:

    流控制可能存在问题,This stackOverflow post 有一些关于流控制的好信息。

    解决此问题的方法之一:

    flow = protractor.promise.controlFlow();
    flow.execute(function(){
        browser.ignoreSynchronization = true;
        browser.get(link);
        browser.ignoreSynchronization = false;
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-31
      • 1970-01-01
      • 2015-08-27
      • 1970-01-01
      • 2015-05-14
      • 1970-01-01
      • 2014-09-09
      相关资源
      最近更新 更多