When I execute node elementexplorer.js http://127.0.0.1:8080/app/view1
I get the following error:
There was a webdriver error: Error Error while waiting for Protractor to sync with the page: "root element (body) has no injector. this may mean it is not inside ng-app."
Please let me know how to provide the rootelement
option.
At the moment, rootElement defaults to body. If you don't have your ng-app in the body, you will get that error. It can be set manually tho.
You need to change the rootElement. You can do it directly from the interactive view by running:
Assuming that your ng-app is located at
div#ng-app-located-here
In this case, you need to specify on which element your
ng-app
is set. AddrootElement
in your protractorconf.js
, for example:FYI, this is because protractor angular-specific custom locators, like
by.binding
orby.model
userootElement
as a root for the search, quote from the change log: