Skip to content Skip to sidebar Skip to footer

Protractor - Works Well On Localhost But Remote Throws Timeout - Async Callback Was Not Invoked Within Timeout Specified

When I execute protractor protractor.conf.js --baseUrl=http://localhost:4200/, it works well - fills data, validates elements, etc. When I try to test exactly the same website via

Solution 1:

UPDATED: Completed changed original proposed answer.

This issue could be due to the nature of your login page. If your login is non-angular then you must instruct protractor not to wait for angular to become testable (which it will by default). To do this you can use the browser.waitForAngularEnabled(false) command which it the recommended new way as opposed to the previous browser.ignoreSynchronization = true.

After you have logged into your application you can set your browser.waitForAngularEnabled back to true and the rest of your tests in that spec should behave correctly.

describe('Main', function {
  beforeAll(function () {
      browser.waitForAngularEnabled(false);
      Site.login();
      //after you have successfully logged into you site you can 
      browser.waitForAngularEnabled(true);
  });

  it('should show the main page', function () {
     //Your code
  });
});

Post a Comment for "Protractor - Works Well On Localhost But Remote Throws Timeout - Async Callback Was Not Invoked Within Timeout Specified"