I am currently working on an application that requires the use of Selenium to navigate to the next page and verify if the required information is found. If the information is not found, then it needs to come back to the same page and proceed to click on the next user's information. This process continues until all users' links have been checked.
My approach involves creating a List of all the user links to iterate through using an enhanced for loop. However, I have encountered an issue where Selenium returns the exception 'org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document' when trying to click on the second user link after coming back from the first one. I attempted to use the back() method but it did not work. Is there a workaround for this problem?
Thank you, Karim