简体   繁体   English

Protractor.js:加载页面时出错

[英]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.

相关问题 Protractor.js如何在硬错误重新加载之间等待结果 - Protractor.js how to wait for a result between hard page reload without error protractor.js Expected []等于[“…”,“…”] - protractor.js Expected[] to equal [“…”,“…”] 从inquirer.js菜单运行protractor.js测试 - Running a protractor.js test from a inquirer.js menu 在protractor.js中运行的异步测试是否存在默认超时 - Is there a default time-out for asynchronous tests running in protractor.js 如何在Angulars文档的上下文中使用protractor.js? - How do you use protractor.js in the context of Angulars documentation? Protractor.js用于水平滚动的测试用例和用于angular2的垂直滚动 - Protractor.js test case for Horizontal Scrolling and vertical Scrolling in angular2 量角器“等待量角器与页面同步时出错”浏览Angular站点 - Protractor “Error while waiting for Protractor to sync with the page” browsing Angular site 使用Angular.js加载页面时出现错误 - Getting error while loading my page using Angular.js 执行量角器测试时出现“失败:等待量角器与页面同步时出错” - "Failed: Error while waiting for Protractor to sync with the page" while executing Protractor tests jasmineNodeOpts:执行量角器protractorConfig.js时出现意外的标识符错误 - jasmineNodeOpts: Unexpected identifier error while executing protractor protractorConfig.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM