Protractor: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability\nhttp://errors.angularjs.org/1.3.15/ng/test"

Created on 29 Sep 2015  路  12Comments  路  Source: angular/protractor

Hi,
Protractor v2.2.0
Mac 10.10.5
running tests on chrome and I'm seeing the below error

Message:
     Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability\nhttp://errors.angularjs.org/1.3.15/ng/test"
   Stacktrace:
     undefined

and im seeing the above error on and off.

needs more info

Most helpful comment

I am using Protractor 4.0.9 getting below error. We have ng-app in the body though
Failed: Error while waiting for Protractor to sync with the page: "[ng:test] http://errors.angularjs.org/1.5.8/ng/test"

All 12 comments

Have you set the rootEl in your configuration file? It looks like that element is (sometimes?) not part of your Angular application.

i do have rootElement set in the config file.

    //For rootElements
    rootElement : 'body',

it fails in the non angular page which is at login and logout pages.But its not consistence. some times it passes and some times it fails.

It's probably passing and failing sometimes because of a race condition with when you navigate to the non-angular page. If it tries to grab the body element after navigation is done (and you're on the Angular page), then it will work fine. If it grabs before (when the non-Angular login page is still loaded), you'll get this error.

You need to have a robust method of telling when you're done with the login page. You probably want to use browser.wait for some condition.

Closing this as a specific issue, not a generic bug.

@juliemr may be the error need to show more info rather saying undefined stacktrace

I had similar problems with Chrome on Linux. They completely disappeared with update to 2.3.0.

i also have this issue, when i run a.spec.js and b.spec.js together, it will show this error; but when i run a.spec.js and b.spec.js alone, all are fine, too strange! Anyone know what's the problem?

@abbymrs
yes even i encountered this issue.
"TypeError: Cannot create property 'stack' on string 'Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability

This error occurs only when two specs are run together but it passes when run individually

Same here. Its random. It works well when tests are run separately using jasmine fit but when run as a suit it shows up. Also this passes all the time in local machine but happens only when ran in sauce labs

I am using Protractor 4.0.9 getting below error. We have ng-app in the body though
Failed: Error while waiting for Protractor to sync with the page: "[ng:test] http://errors.angularjs.org/1.5.8/ng/test"

This issue seems to happen when Angular is brought in through bootstrap and not having the "ng-app" in the body tag I believe. Any solution as of yet?

@srajagopalan1712,

Thank you. My problem solved by adding ng-app tag in html page . reference below.

we had the same problem, the solution was, to remove external js includes from index.html,
e.g google api packages.
Google had no response sometimes => no page loading => no protractor tests.

Was this page helpful?
0 / 5 - 0 ratings