question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Timed out waiting for asynchronous Angular tasks to finish after 500 seconds.

See original GitHub issue

Below is protractor config.js

` ‘use strict’; exports.config = {

seleniumAddress: 'http://localhost:4444/wd/hub',

getPageTimeout: 60000,
allScriptsTimeout: 500000, 
jasmineNodeOpts: {defaultTimeoutInterval: 10000},
ignoreUncaughtExceptions: false,

framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
multiCapabilities: [{
 'browserName': 'chrome',
 'shardTestFiles' : true,
 'maxInstances' : 3,
 'maxSession':3
 }]
/*capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
        'mobileEmulation' : {
            'deviceName': 'Google Nexus 5'
        }
    }
}*/,

// Spec patterns are relative to this directory.
specs: [
    '../features/Login.feature'
],

baseUrl: 'http://libris.api.dev.bv',
params: {
    userName: 'test',
    password: 'password',
	Token:'',

    ecWait: {
        waitTime: 100000
    },
},

plugins: [{
    package: 'protractor-multiple-cucumber-html-reporter-plugin',
    options:{
        // read the options part
        automaticallyGenerateReport: true,
        removeExistingJsonReportFile: true,
        removeOriginalJsonReportFile: true
    }
}],


onPrepare: function () {
    var chai = require('chai');
    chai.use(require('chai-as-promised'));
    chai.should();
    //browser.manage().window().maximize(); // maximize the browser before executing the feature files
    var timeStamp = require('../commons/commons.js');
    timeStamp.setTimeStamp()
},

onComplete: function () {
    console.log('all tests have finished');
    browser.close();
},

// This setting tells protractor to wait for all apps

// to load on the page instead of just the first.
// useAllAngular2AppRoots: true,
rootElement: '[ng-app="app"]',
ng12Hybrid: false,

cucumberOpts: {
    require: ['../commons/*.js', '../steps/*.js', '../support/*.js'],
    tags: false,
    strict: true,
    'no-colors': true,
    dryRun: false,
    format: ['json:cucumberReports/cucumber.json']
   // parallel: 2
}

}; `

below is package.json

{ "name": "ProtractorDemo", "version": "0.0.0", "description": "protractor demo", "author": "Aniruddh Solanki", "main": "config/conf.js", "dependencies": { "chai": "^4.1.2", "chai-as-promised": "^7.1.1", "cucumber": "^4.2.1", "cucumber-html-reporter": "^4.0.2", "protractor-cucumber-framework": "^5.0.0", "cucumber-html-report": "^0.6.5", "protractor": "^5.3.1", "relative-path": "^1.1.0", "protractor-multiple-cucumber-html-reporter-plugin":"1.7.0" }, "scripts": { "test": "./node_modules/.bin/protractor config/conf.js" }, "license": "MIT" }

When we run the test it throws an as below

Timed out waiting for asynchronous Angular tasks to finish after 500 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, [ng-model=“user”]). The following tasks were pending:

  • $timeout: function c(e){t.$broadcast(“$keepalive”),i.isObject(n.http)?r(n.http).success(function(n,i){u(n,i,e)}).error(function(n,i){u(n,i,e)}):e||a()}
  • $timeout: function c(){s.idling=!s.idling;var i=s.idling?“Start”:“End”;e.$broadcast(“$idle”+i),s.idling?(a(),s.countdown=n.warningDuration,l()):u()} [14:54:13] E/launcher - ScriptTimeoutError: asynchronous script timeout: result was not received in 500 seconds

ng-app is defined in html tag <html lang="en" ng-app="app" class="ng-scope">

also tried changing rootElement: ‘[ng-app=“app”]’, to rootElement: ‘html’, but it does not work.

Please help

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Suprabhadcommented, May 18, 2018

@IgorSasovets I have tried your suggestion which made it work so close the issue. Thankyou

0reactions
IgorSasovetscommented, May 18, 2018

@Suprabhad , are there any updates on this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Protractor : Failed: Timed out waiting for asynchronous ...
Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds. This may be because the current page is not an...
Read more >
tick - Angular
Simulates the asynchronous passage of time for the timers in the ... The microtasks queue is drained at the very start of this...
Read more >
Handling long Web Requests with Asynchronous Request ...
Long requests can time out the Web server Web servers are set up with certain timeouts to kill connections after the timeout period...
Read more >
7 Costly Mistakes That One Needs to Avoid in Angular Test ...
Here we discuss some reasons for test timeouts and other common failures. ... Protractor waits for Angular async tasks to be completed.
Read more >
The event loop - JavaScript - MDN Web Docs - Mozilla
When foo returns, the top frame element is popped out of the stack ... The execution depends on the number of waiting tasks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found