I’m getting an error when using selenium for my app which is built in C#.
OpenQA.Selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document
IWebElement e = driver.FindElement(By.XPath(link_click), 10);
e.Click();
The error line is in the e.Click() but this was working fine earlier by using the same XPath but failed on the last try. How can I fix it?