I want to be able to iterate through elements of a particular class and click on them. I tried the following code but it doesn't always click on the element specified
browser.elements('css selector', element.articleItemTitle,function (links) {
for (var i=0; i < links.value.length; i++) {
browser.waitForElementVisible('body');
browser.pause(1000);
browser.elementIdClick(links.value[i].ELEMENT);
browser.waitForElementVisible('.article-detail');
browser.expect.element(element.postHeroTitle).to.be.present;
browser.back();
}
});
I get the following error:
stale element reference: element is not attached to the page document
Please use the mailing list to ask for assistance.