Greg Dougherty Greg Dougherty - 5 months ago 251
AngularJS Question

No injector found for element argument to getTestability

I'm trying to run this tutorial against my own AngularJS code. I can't get past the first test. Any attempt to pull any information from my page gets this error:

Error: 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.8/ng/test"
Stacktrace:
Error: 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.8/ng/test"
at Error (<anonymous>)
==== async task ====

Protractor.waitForAngular()
==== async task ====
Asynchronous test function: it()


Does anyone have a Protractor tutorial that shows you how to target your own code, rather than someone else's code?

Thank you in advance

Answer

The answer is that you must have <html ng-app> or <html ng-app = ""> at the top of your html page in order to use Protractor.

Having an app as part of a <div ng-app = "">, for example, will not work

Comments