Skip to content
Latchkey

Selenium "ElementNotInteractableException" / "element click intercepted"

Selenium found the element but could not interact with it: it is not visible, is outside the viewport, or another element (a modal, sticky header, overlay) sits on top of the click point.

What this error means

A click()/send_keys() fails with "ElementNotInteractableException" or "element click intercepted: Other element would receive the click." The element is in the DOM but not actionable at that moment - often a CI-only timing/layout difference.

Selenium output
selenium.common.exceptions.ElementClickInterceptedException: Message:
element click intercepted: Element <button id="save"> is not clickable
at point (240, 480). Other element would receive the click:
<div class="modal-backdrop">

Common causes

Element covered by an overlay

A modal backdrop, cookie banner, or sticky element overlaps the target so the click lands on the overlay instead. Common when an animation has not finished.

Element hidden or off-screen

The element is display:none/zero-size or below the fold. Selenium will not interact with non-visible elements, and the headless window size differs from local.

How to fix it

Wait for actionability, dismiss overlays

Wait until the element is clickable (and any overlay is gone) before interacting.

test_app.py
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
btn = WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.ID, 'save')))
btn.click()

Set a real window size and scroll into view

  1. Set a fixed headless window size (e.g. --window-size=1920,1080) so layout matches local.
  2. Scroll the element into view before clicking.
  3. Wait for animations/backdrops to finish instead of a fixed sleep.

How to prevent it

  • Wait on element_to_be_clickable, not just presence.
  • Pin a headless window size that matches the app’s layout.
  • Dismiss banners/modals deterministically before interacting.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →