[英]Protractor.js:Error while loading the page
I am new to protractor.js
. 我是
protractor.js
新手。 I have a scenario where I am getting the page to be tested and in that page I am finding an element to click and then redirect to some other page. 我有一种情况,要对页面进行测试,然后在该页面中找到要单击的元素,然后重定向到其他页面。
config.js
: config.js
:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
rootElement: '.apt.ui',
specs: ['./protractor-tests/homeTest.js'],
jasmineNodeOpts: {
showColors: true
}
}; };
home test page: 家庭测试页:
These are the test case which I wrote to implement the scenario. 这些是我为实现方案编写的测试用例。
describe('Home Test', function() {
it('It should click product', function() {
var targetUrl = 'http://domain/home';
browser.get(targetUrl);
})
it('looking for the product', function() {
browser.waitForAngular();
var productMenu = element(By.xpath('/html/body/div[1]/headerdiv[1]/section/div[1]/apt-nav-bar/div/div[2]/div[2]/ul/li[2]/a/span'));
productMenu.isPresent();
productMenu.click();
expect(browser.getCurrentUrl()).not.toEqual('http://domain/home');
expect(browser.getCurrentUrl()).toEqual('http://domain/products');
})
}); });
but when I run this I am getting the error: 但是当我运行这个时,我得到了错误:
Message:
Failed: Error while waiting for Protractor to sync with the page: "Cannot read property '$$testability' of undefined"
I don't understand this . 我不明白。 Any help would be appreciated.
任何帮助,将不胜感激。
This was an issue with Protractor, which has been mentioned here . 这是量角器的一个问题, 这里已提到。 Please read through the issue.
请仔细阅读问题。 This issue has been fixed in
Protractor 5.1.2
. 此问题已在
Protractor 5.1.2
修复。 Please update your protractor and if you're still able to reproduce this, please submit an issue with the Protractor team. 请更新量角器,如果仍然可以重现,请向量角器团队提交问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.