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.

Disabling flow control generates error: "Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined."

See original GitHub issue

Here is my config:

exports.config = {
  capabilities: {
    'browserName': 'chrome'
  },
  seleniumAddress: 'http://localhost:4444/wd/hub',
  framework: 'jasmine',
  specs: ['test.spec.ts'],
  SELENIUM_PROMISE_MANAGER: false,
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  },	
  beforeLaunch: function () {
    require('ts-node/register')
  }
};

And here is my simple test:

import {
    browser,
    ExpectedConditions,
    $
} from 'protractor';

describe('When user click \"Test\" button', async () => {
  beforeAll(async () => {
    expect(browser.getCurrentUrl()).toContain('myawesomewebsite');
  });

  it ("should click the button", async () => {
    var button = $(".button");
    button.click();
  });
});

This throws me the following error:

UnhandledPromiseRejectionWarning: Error: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined.  This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping.  See http://git.io/v4gXM for details"

However it works great if I set SELENIUM_PROMISE_MANAGER to true.

According to the simplicity of this test, this seems to be a bug with protractor itself, am I wrong?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
CrispusDHcommented, Feb 12, 2019

you have to add .waitForAngularEnabled(false) in the onPrepare property of protractor.conf:

onPrepare: async () => {
    await browser.waitForAngularEnabled(false);
    ...
}
0reactions
Cornchips007commented, Sep 6, 2020

@Kurt29 is the page per chance Unicode encoded somehow and has the setting <meta charset="utf-8" /> in the head?

I’m sitting with the same problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while waiting for Protractor to sync with the page: "both ...
You got this error because Protractor by default wait angular page is loaded. If you work with non angular you should add await...
Read more >
angular/protractor - Gitter
Failed: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined.
Read more >
Testing with Protractor: how to fix synchronization issues
"Waiting for Angular" timeout error · An error in your test results will look like this:&nbsp Timed out waiting for asynchronous Angular tasks...
Read more >
Debugging Protractor Tests
Protractor will fail when it cannot find the Angular library on a page. If your test needs to interact with a non-angular page,...
Read more >
[Code example]-Protractor no waiting for web page to change
Using Angular 5 with Protractor. Having trouble waiting for the browser url to change to see if the user logs in and then...
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