How do you avoid Stale Element Exception | Selenium C# Forum
M
MAHESH LAXMANRAO KHOLE Posted on 01/03/2019
  1. How do you avoid Stale Element Exception?
  2. How to Check if the image loaded is broken or not

G
gunjan Replied on 02/03/2019

To control the staleness of an element, try adding the explicit wait for the element or else try this:

bool staleElement = true;
while (staleElement)
{
try
{
driver.FindElement(By.XPath("")).Click();
staleElement = false;
}
catch (StaleElementReferenceException)
{
staleElement = true;
}
}


G
gunjan Replied on 02/03/2019

To check if the image loaded is broken or not, try this link-

https://stackoverflow.com/questions/43389340/how-to-find-broken-images-for-an-entire-web-site-in-selenium-webdriver-using-jav


M
MAHESH LAXMANRAO KHOLE Replied on 03/03/2019

Thanks Gunjan