Selenium checking stale did not work for chrome driver version 126:
public boolean isElementStale(WebElement element) {
try {
element.isEnabled();
return false;
} catch (StaleElementReferenceException e) {
return true;
}
}
It works for chrome driver older version 112.
For the new version 126, it throws
org.openqa.selenium.NoSuchElementException: no such element: element not found
How to check if an element becomes stale?