Random “Element is no longer attached to the DOM” StaleElementReferenceException
Yes, if you’re having problems with StaleElementReferenceExceptions it’s because there is a race condition. Consider the following scenario: WebElement element = driver.findElement(By.id(“foo”)); // DOM changes – page is refreshed, or element is removed and re-added element.click(); Now at the point where you’re clicking the element, the element reference is no longer valid. It’s close to … Read more