Hi All,
I have a check on each web page as follows:
TEST:
Utilities.WaitOnPageForXPathClickable("(//LABEL[@tabindex='0'][text()='No'][text()='No'])[6]");
FRAMEWORK:
public static void WaitOnPageForXPathClickable(string selector) { new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementToBeClickable((By.XPath(selector)))); }
All I’m trying to do is to wait until a particular element on the page is clickable before actually clicking it, but the results are intermittent. Sometimes it works fine and other times I get the following message:
OpenQA.Selenium.StaleElementReferenceException : The element reference of stale: either the element is no longer attached to the DOM or the page has been refreshed
Any ideas why this would happen?
Thanks
James