2015-03-03 11 views

risposta

4

In questo caso, è necessario specificare su quale elemento è impostato ng-app. Aggiungere rootElement nel vostro goniometro conf.js, ad esempio:

rootElement: 'div#nested-ng-app' // by default, it is 'body' 

Cordiali saluti, questo è perché goniometro angolare specifica localizzatori personalizzati, come by.binding o by.model uso rootElement come una radice per la ricerca, citazione dal change log:

Protractor's custom locators (by.binding, by.model, etc) use config.rootElement as the root for all their searches. This meant that config.rootElement was used both to specify how to get hold of Angular's injector as well as where to begin searching for elements. This does not work for all cases, for example if a dialog should be searched for elements but is a sibling, not a child, of ng-app.

7

Al momento, rootElement ha come valore predefinito il corpo. Se non hai la tua ng-app nel corpo, otterrai questo errore. Può essere impostato manualmente.

È necessario modificare l'oggetto rootElement. È possibile farlo direttamente dalla visualizzazione interattiva in esecuzione:

browser.rootEl = 'div#ng-app-located-here'; 

Supponendo che il vostro ng-app si trova a div#ng-app-located-here

Problemi correlati