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:
Like the accepted answer implies, the problem lies in letting protractor know what's the root of your app, this is where ng-app is defined. By default this is expected to be the tag but your code seems to have it somewhere else. Nevertheless you can actually change that behavior in the config file.
From the Protractor reference config file:
// CSS Selector for the element housing the angular app - this defaults to // body, but is necessary if ng-app is on a descendant of . rootElement: 'body',
For example, if your ng-app is within a div like this:
You could use Since it's a CSS selector, you could also use the square brackets syntax to select by attribute, like this: This would select the element that contains the attribute ng-app, no matter which one it is.rootElement: '#my-app'rootElement: '[ng-app]'