I'm having trouble accessing elements via methods such as by.binding()
.
The project setup is as follows:
Non-angular website
|
--> Iframe
|
--> Angular app
Here's a snippet of what I'm trying to do:
// Disable sync
browser.ignoreSynchronization = true;
// Navigate to non-angular website
browser.driver.get('http://non-angular.com');
// Switch to angular app (inside the iframe)
browser.switchTo().frame('angular-iframe');
// Search for an element
browser.driver.findElement(by.id('title')); // -> Works
element(by.binding('model.title')); // -> Fails
UnknownError: unknown error: [ng:test] no injector found for element argument to getTestability
Any idea of what I'm missing here?
Copyright Notice:Content Author:「Pablo」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30597802/sync-protractor-with-an-angular-app-hosted-inside-an-iframe-by-a-non-angular-web