Skip to content
Latchkey

Selenium "ElementClickInterceptedException" - Element Obscured

Selenium tried to click the element’s center, but a different element - a sticky header, cookie banner, modal backdrop, or tooltip - sits on top and would receive the click instead. Selenium refuses to click the wrong element.

What this error means

A .click() fails with "ElementClickInterceptedException: element click intercepted: Other element would receive the click." The target is on the page, but something overlays it at the click point.

Selenium output
ElementClickInterceptedException: Message: element click intercepted:
Element <button id="save"> is not clickable at point (480, 90).
Other element would receive the click: <div class="cookie-banner">

Common causes

An overlay covers the target

A cookie banner, modal, toast, or sticky header overlaps the element at its click point, so the overlay would receive the click.

Element not scrolled fully into view

A sticky header covers the top of the viewport; an element scrolled to just under it is technically visible but obscured at its click coordinate.

How to fix it

Dismiss the overlay or scroll into view

Close the blocking element, or scroll the target into a clickable position first.

Test.java
// dismiss the banner, then click
driver.findElement(By.cssSelector(".cookie-banner .accept")).click();
// or scroll the target into view
((JavascriptExecutor) driver)
  .executeScript("arguments[0].scrollIntoView({block:'center'});", target);
target.click();

Wait for the overlay to disappear

  1. Use an explicit wait for the overlay to become invisible before clicking.
  2. Prefer dismissing modals/banners over forcing a JS click, which bypasses real user behavior.
  3. Avoid clicking under sticky headers - scroll the element to center first.

How to prevent it

  • Dismiss cookie/consent banners in setup before interacting.
  • Scroll targets to viewport center before clicking.
  • Wait for modal/overlay close animations to finish.

Related guides

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