Phil
Phil

Reputation: 504

Protractor Chrome angular could not be found on the page

I have had E2E tests set up to run in Chrome for a while, however they no longer work. I'm not sure when they stopped working as they've been neglected. The project uses grunt-protractor-runner (2.1.2) which uses protractor 2.5.1

I get the following error:

Uncaught exception: Error while waiting for Protractor to sync with the page: "angular could not be found on the window"

Below is screenshot of the output:

enter image description here

It actually opens up Chrome , however doesn't navigate anywhere. The omnibox says "data:," and nothing else:

enter image description here

One thing I'm wondering, is that chrome got somewhat locked down - and the omni box doesn't work as a google browser now - but I don't see why that would affect it as it should hit a URL directly.

Can anyone advise please?

Upvotes: 1

Views: 764

Answers (2)

TesterPhi
TesterPhi

Reputation: 346

Ive seen this problem a few times myself. The last time I fixed it was by updating to the latest version of chrome driver and the latest version of protractor. Certain earlier combinations of chrome driver and protractor can cause this problem.

Grunt protractor runner can be used with latest versions of protractor according to its documentation. I suggest having a little read of how to update to the latest versions?

Upvotes: 0

Andrew Eisenberg
Andrew Eisenberg

Reputation: 28757

Typically this error happens in one of two ways:

  1. There is a race condition where protractor wants to start the tests before the page is fully loaded. In this case, make sure that your onPrepare function in your protractor conf returns a promise that gets resolved once all preparations work.
  2. The test does not navigate to the app's url. In this case, make sure that you run `browser.get();
  3. There is an error trying to start your app. This one's a little harder to fix. You can try running the protractor element explorer and see if there's an error in the browser console.

Upvotes: 1

Related Questions