【发布时间】:2018-12-07 20:13:26
【问题描述】:
我在 Protractor 中的测试有问题。
我需要这样的东西:
'找到 iframe,点击它,然后为 ng-model 设置值。'
所以我的代码看起来像:
browser.switchTo().frame(element(by.model('myModel')).getWebElement());
browser.findElement(by.className('testClass')).click();
var elm = element(by.model("myModel"));
elm.evaluate("fields.myModel = 'test';");
但不幸的是我有如下错误:
Failed: Error while waiting for Protractor to sync with the page:
"both angularJS testability and angular testability are undefined.
This could be either because this is a non-angular page or because
your test involves client-side navigation, which can interfere with
Protractor's bootstrapping. See http://git.io/v4gXM for details
这个页面是角页面,我不知道如何处理它。 我不能使用'browser.ignoreSynchronization = true',因为我有错误,那个角度没有定义。 我也无法刷新浏览器,因为那样我会丢失我的内容(点击后会显示),所以我不知道该怎么做。
非常感谢您提供的任何提示。
【问题讨论】:
标签: angularjs protractor