# StaleElementReferenceException (Selenium)

Source: https://www.observeone.com/community/errors/selenium/stale-element-reference

[ObserveOne](/)[Features](/#features)[Pricing](/#pricing)[Blog](/blog)[CLI](/cli)[Docs](/docs)

[Sign in](https://app.observeone.com/auth?tab=signin)[Start Free](https://app.observeone.com/auth?tab=signup)

[Error Dictionary](/community/errors)/[Selenium](/community/errors/selenium)/stale-element-referencehigh

# StaleElementReferenceException

The element previously located is no longer attached to the DOM. The page was refreshed, navigated, or the element was re-rendered by JavaScript.

## Common Causes

- 1Page was refreshed or navigated after locating the element
- 2JavaScript framework re-rendered the component (React, Angular, Vue)
- 3AJAX call updated the DOM, replacing the element
- 4Element was in a list that was re-sorted or filtered

## How to Fix

### Re-locate the element before each interaction

// Python
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

element = WebDriverWait(driver, 10).until(
 EC.presence_of_element_located((By.ID, 'my-element'))
)
element.click()Always re-find the element using explicit waits. Never store element references for later use across page interactions.

### Use a retry pattern

// Java
public void clickWithRetry(By locator, int maxRetries) {
 for (int i = 0; i < maxRetries; i++) {
 try {
 driver.findElement(locator).click();
 return;
 } catch (StaleElementReferenceException e) {
 if (i == maxRetries - 1) throw e;
 }
 }
}Wrap element interactions in a retry loop to handle transient staleness during DOM updates.

## How ObserveOne Helps

ObserveOne detects DOM instability patterns and automatically retries interactions with stale elements.

[Start Monitoring Free](https://app.observeone.com/auth?tab=signup)

## Related Errors

[NoSuchElementExceptionNo element matching the locator strategy could be found in the current page DOM. The element may not exist, may not have loaded yet, or the locator may be incorrect.](/community/errors/selenium/no-such-element)[ElementNotInteractableExceptionThe element exists in the DOM but cannot be interacted with. It may be hidden, disabled, or covered by another element.](/community/errors/selenium/element-not-interactable)[ElementClickInterceptedExceptionThe click command could not be completed because another element would receive the click at the target coordinates. A different element is covering the target.](/community/errors/selenium/element-click-intercepted)[SessionNotCreatedException: Could not start a new sessionWebDriver could not create a new browser session. Usually caused by a version mismatch between the browser and the driver.](/community/errors/selenium/session-not-created)[WebDriverException: 'chromedriver' executable needs to be in PATHThe WebDriver binary (chromedriver, geckodriver, etc.) cannot be found in the system PATH. Selenium needs the driver binary to communicate with the browser.](/community/errors/selenium/webdriver-not-found)

ObserveOne

Agentic QA and synthetic monitoring built for engineering teams. Plan, generate, and run suites from the web UI. Connect to CI for reliable coverage across critical journeys.

### Product

- [Features](/#features)
- [Pricing](/#pricing)
- [QA Coverage](/qa-coverage)
- [API Monitoring](/api-monitoring)
- [Free Website Check](/free-website-check)

### Developers

- [CLI](/cli)
- [Docs](/docs)
- [For Agents](/agents)
- [Self-host (oo-workers)](/workers)
- [Status Pages](/status)
- [Netlify Extension](https://app.netlify.com/extensions/mzs1lgc3-observeone)

### Resources

- [Blog](/blog)
- [Bug Book](/bug-book)
- [Guides](/community/guides)
- [Tools](/community/tools)
- [Error Dictionary](/community/errors)

### Compare

- [Tool Comparisons](/compare)
- [Tool Alternatives](/alternatives)
- [Best by Category](/best)
- [Search](/search)

© 2026 ObserveOne. All rights reserved.

[About](/about)[Privacy Policy](/privacy)[Terms of Service](/terms)[Affiliates](/affiliates)[Become an Affiliate](/affiliate-terms)
