I'm trying to iterate over the links and upon each click assert the page exists and return back. So far I've got to this function in the test case. The problem is that after clicking the first link and navigating back browser navigates back one more time and then the iteration is done on the empty page. If I switch back() with init() the test still fails. This is the test case, not a page object command. Please help
ChromeDriver v.2.28.455517 Selenium v2.53.0
browser.elements('css selector', 'specific element', function(allLinks) {
allLinks.value.forEach(function(index) {
console.log('Element value is ' + index.ELEMENT)
browser.elementIdClick(index.ELEMENT, function(res) {
this.waitForElementVisible('body', 2000);
this.back();
this.pause(1000);
});
})
});
via andddrey
No comments:
Post a Comment