Protractor: Timed out waiting for Protractor to synchronize with the page after 100 seconds

Created on 28 Dec 2014  路  6Comments  路  Source: angular/protractor

I've a fairly complex angular app and have just started writing E2E tests for it, in hindsight would have been so much better if we started earlier. I've gone though https://github.com/angular/protractor/blob/master/docs/timeouts.md and have increased the timeout to 100 secs just to see if it helps and it doesn't.

The app is mostly single page but have lots going on, we have socket.io but are not polling. Below is the full error and I've hit a wall. Any pointers to get around this will be very helpful.

Please note that I can see the page loaded in chrome that opens up via webdriver

Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
F

Failures:

  1) Comments should be able to comment on a post
   Message:
     Error: Timed out waiting for Protractor to synchronize with the page after 100 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md
   Stacktrace:
     Error: Timed out waiting for Protractor to synchronize with the page after 100 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md
    at Error (<anonymous>)
==== async task ====
Protractor.waitForAngular()
    at [object Object].<anonymous> (packages/comments/public/tests/comments-spec.js:14:39)
==== async task ====
Asynchronous test function: it()
Error
    at [object Object].<anonymous> (packages/comments/public/tests/comments-spec.js:11:3)
    at Object.<anonymous> (packages/comments/public/tests/comments-spec.js:10:1)

Finished in 101.584 seconds
1 test, 1 assertion, 1 failure

Most helpful comment

Aside from @thilinadinith funny trolling, @juliemr, is there a way of telling which $http or $timeout is pending?
These might as well be a 3rd party component doing this. It would be great to have logging help us troubleshoot. I'm running Protractor with Chromedriver on a headless Ubuntu Jenkins with much options to see what is going on.

All 6 comments

I'm a day old to Protractor, so its very possible that I'm not writing the test correctly, pasting the code below

   describe('Comment System', function() {
  it('should be able to comment on a post', function() {
    browser.get('#!/');

    element(by.model('comment.body')).sendKeys('Test Comment');
    element(by.buttonText('Comment')).click();


  });
});

The problem is polling only, I was able to run the test by ignoreSyncronization = true and putting a browser.sleep.

Wonder if any of you have any tutorial/instruction for me to have both socket.io and protractor synchronise with angular.

Please read the contributing guidelines; these types of questions are ill-suited for GitHub. Thanks!

Without knowing everything that's going on in your Angular app, we can't give any more information about the error. It means that something in angular has a $http or $timeout request that's still pending.

@juliemr - u answer the question he asked for !! cause u are having damn POOR documentation about those issues !!
your code is not user-friendly and clean !!!

@thilinadinith LOL, you just made my day :)

Aside from @thilinadinith funny trolling, @juliemr, is there a way of telling which $http or $timeout is pending?
These might as well be a 3rd party component doing this. It would be great to have logging help us troubleshoot. I'm running Protractor with Chromedriver on a headless Ubuntu Jenkins with much options to see what is going on.

Was this page helpful?
0 / 5 - 0 ratings