I have a page with 50 entries inside and I need to navigate to each one of them one by one. The exception is being thrown after I come back from first one and try to navigate to a 2nd one. After googling for a while I see that it might be because the instance of the main page was deleted. I am using foreach loop and would like the code to continue. the code looks like this:
IReadOnlyCollection<IWebElement> anchors = this.driverIpass.FindElements(By.CssSelector(".card-list-item.ng-scope"));
foreach (IWebElement anchor in anchors)
{
anchor.FindElement(By.XPath("//*[contains(@id,'workitem-goto-tablet-btn')]")).Click();
//below is test button to go back
driverIpass.FindElement(By.Name("editForm:j_idt693")).Click();
}
As you can see all im trying to do here is go in then back for every item in the collection. I am very new to all of this, could someone please put me on the right path ? Thank you