Javascript 我随机得到一个;ScriptTimeoutError";使用量角器

Javascript 我随机得到一个;ScriptTimeoutError";使用量角器,javascript,jasmine,protractor,automated-tests,Javascript,Jasmine,Protractor,Automated Tests,我的测试套件包含200多个测试用例,通常我会在少数测试用例中得到ScriptTimeoutError。此错误是随机的,不特定于特定的测试用例。 请注意:allScriptsTimeout:120000是在conf.js文件中设置的 量角器版本=5.1.2 请查看错误日志 Failed: Timed out waiting for asynchronous Angular tasks to finish after 120 seconds. This may be because the c

我的测试套件包含200多个测试用例,通常我会在少数测试用例中得到ScriptTimeoutError。此错误是随机的,不特定于特定的测试用例。 请注意:allScriptsTimeout:120000是在conf.js文件中设置的

量角器版本=5.1.2

请查看错误日志

   Failed: Timed out waiting for asynchronous Angular tasks to finish after 120 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.cssContainingText(".ng-binding", "My example").
    The following tasks were pending:
     - $http: https://api.example.com/api/exampleionUsers
  Stack:
    ScriptTimeoutError: asynchronous script timeout: result was not received in 120 seconds
      (Session info: chrome=59.0.3071.86)
      (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 120.07 seconds
    Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
    System info: host: 'LAPTOP-RNQ2JQBE', ip: '192.168.89.84', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
    Driver info: org.openqa.selenium.chrome.ChromeDriver
    Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.29.461591 (62ebf098771772160f391d75e589dc567915b233), userDataDir=C:\Users\NEXTGEN\AppData\Local\Temp\scoped_dir15404_10872}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=59.0.3071.86, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]

没有人回答,所以我发布了一个帖子,表明要将这个(onPrepare:function(){browser.manage().timeouts().setScriptTimeout(60000);})放到量角器配置文件中,希望如此helps@FooBar请检查日志,它说异步调用($https和$timeout)等待了120秒才完成。我正在等待通过在conf.js文件中设置allScriptsTimeout:120000来完成异步脚本。对不起,我无法帮助您使用量角器,只是试图帮助您。将这些60.000修改为180.000,然后尝试,有时可能需要123秒;)