没有注入发现元素参数getTestability [英] No injector found for element argument to getTestability
问题描述
我试图运行本教程对不住自己AngularJS code。我不能让过去的第一次测试。任何企图从我的页面发送任何信息得到这个错误:
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:
Error: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability\nhttp://errors.angularjs.org/1.3.8/ng/test"
Stacktrace:
Error: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability\nhttp://errors.angularjs.org/1.3.8/ng/test"
at Error (<anonymous>)
==== async task ====
Protractor.waitForAngular()
==== async task ====
Asynchronous test function: it()
有没有人有一个量角器教程将告诉您如何定位自己的code,而不是别人的code的人?
Does anyone have a Protractor tutorial that shows you how to target your own code, rather than someone else's code?
感谢您提前
推荐答案
答案是,你必须有&LT; HTML NG-应用&GT;
或&LT; HTML NG-应用=&GT;
在你的HTML页面,以使用量角器顶部
The answer is that you must have <html ng-app>
or <html ng-app = "">
at the top of your html page in order to use Protractor.
有一个应用程序的一部分的&LT; DIV NG-应用=&GT;
,例如,将无法正常工作
Having an app as part of a <div ng-app = "">
, for example, will not work
这篇关于没有注入发现元素参数getTestability的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!