protractor icon indicating copy to clipboard operation
protractor copied to clipboard

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

Open dipen opened this issue 11 years ago • 6 comments

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

dipen avatar Dec 28 '14 02:12 dipen

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();


  });
});

dipen avatar Dec 28 '14 02:12 dipen

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.

dipen avatar Dec 28 '14 07:12 dipen

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 avatar Dec 30 '14 20:12 juliemr

@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 avatar Mar 10 '15 10:03 thilinadinith

@thilinadinith LOL, you just made my day :)

kalabiyau avatar Apr 13 '15 18:04 kalabiyau

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.

gkohen avatar Apr 15 '15 15:04 gkohen