【发布时间】:2015-06-29 03:58:23
【问题描述】:
google.com 不是 Angular 应用程序,但 Protractor 应该仍然可以对其进行测试,对吧?我一直在尝试对搜索进行简单测试,但一直出错。
规格:
browser.ignoreSynchronization = true;
describe('Google Demo', function() {
it('Should Search', function() {
browser.get('http://google.com/');
browser.wait(element(By.id('q')).isPresent);
element(By.id('q')).sendKeys('please work');
});
});
错误是:
Failures:
1) Google Demo Should Search
Message: TypeError: Cannot read property 'count' of undefined
我做错了什么?如有任何帮助,我将不胜感激!
【问题讨论】:
-
我认为你应该尝试 By.name('q') 而不是 By.id('q')。
-
相同的结果,Sakshi Singla
-
我推荐使用这个:github.com/andresdominguez/elementor 这样你就知道它是否有效,它是一个很棒的工具
标签: testing selenium protractor