Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor Timeout - "Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds."

As an e2e tester who has little interaction with the developer, how do I find out what is causing the angularJS website to hang? How do I debug the website and provide them with a tangible solution to my problem? Does Chrome Developer provide an answer to this?

My current solution is to use either of the two code snippets below, but from what I have read, this is not ideal.

browser.sleep();
browser.ignoreSynchronization = true;

I am getting a similar problems to the below:

Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds

Yes, the most common reason is when application continuously polls $timeout or $http, Protractor will wait indefinitely and time out. But this can also occur in scenarios where App takes more than 11 seconds

Protractor test a bootstrap modal - not angular page - timeout

You might have more luck turning the synchronization off temporarily:

like image 718
Ged Avatar asked Nov 08 '22 20:11

Ged


1 Answers

The link http://www.protractortest.org/#/debugging would be a good place to start , if you are trying to debug your test run.

The browser.ignoreSynchronization = true; is used in cases when there is a non angular page in between angular pages. Example when there is a non-angular login page before you can navigate to Angular pages. Once you have naviagted from the non-angular page to the angular pages, you would need to set the flage to true i.e. browser.ignoreSynchronization = false;

browser.ignoreSynchronization = true; has changed to browser.waitForAngularEnabled .

For any timeout related issues , look at http://www.protractortest.org/#/timeouts

Look at http://www.protractortest.org/#/api for more info.

like image 179
Jagannath Avatar answered Nov 15 '22 12:11

Jagannath