What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Intermittent Selenium clicks in Chromium-based Microsoft Edge are usually synchronization or hit-testing failures: the page may still be rendering, replacing, animating, or covering the target when Selenium tries to interact with it. Replace fixed sleeps with an explicit wait for a usable element, inspect overlays, and locate the element again immediately before clicking. This guide focuses on Selenium 4 with current Chromium Edge, not the retired EdgeHTML driver.

Why an EdgeDriver click works sometimes and fails other times

A successful page navigation does not necessarily mean the interface is ready for the next click. Selenium’s navigation wait is tied to the document’s ready state; JavaScript can continue changing the page afterward. If a test acts during that gap, the same command may succeed on one run and fail on another. Selenium identifies this race between application state and test execution as a primary cause of flaky tests: Waiting Strategies.

Clicking is also a hit-testing operation, not just a command sent to a stored element. Selenium checks whether the target is visible, enabled, and unobscured before clicking. A sticky header, modal, cookie banner, loading mask, popup, or animation can change what is actually underneath the pointer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with the exact exception

ElementClickInterceptedException

This means Selenium determined that a different element would receive the click. Look for an overlay or another part of the page covering the target, including a header that overlaps it after scrolling. Selenium describes the behavior and common causes in Understanding Common Errors.

StaleElementReferenceException

This means the stored WebElement no longer refers to the current DOM element. A front-end framework may have replaced the component after the test found it. Do not keep clicking the old reference: wait for the updated page state, then locate a fresh element. See Selenium’s error guidance.

Other symptoms

If there is no exception but the expected action does not happen, verify that the locator matched the intended control and that the page reached the state required for the action. A hidden duplicate or a nested node can make a locator appear unreliable. Record the URL, locator, viewport, and screenshot at the point of failure.

Use an explicit wait and locate the target late

For a normal button, wait until Selenium considers it clickable, then click it. This Python example uses Selenium 4’s Edge driver support:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


driver = webdriver.Edge()
wait = WebDriverWait(driver, 15)

button = wait.until(
    EC.element_to_be_clickable((By.CSS_SELECTOR, "button[data-testid='save']"))
)
button.click()

The locator and 15-second timeout are examples; adapt both to the application. The important part is the explicit condition, which waits for the control to be visible and enabled, and performs the lookup as the test is ready to interact. Selenium documents explicit waits and expected conditions in Waiting Strategies.

“Clickable” is not proof that every possible page-specific overlay has disappeared. If a known mask or dialog blocks the button, wait for that blocker to become invisible or disappear before clicking. Prefer the smallest condition that reflects why the interaction is safe.

Diagnose blockers and DOM changes

Check what covers the target

When interception occurs, inspect the page at the failure point. Common causes include sticky navigation, cookie-consent banners, modal dialogs, pop-ups, loading masks, and CSS or JavaScript animations. Selenium’s troubleshooting material discusses overlapping UI and these forms of interference in Understanding Common Errors.

If the interface has a specific loading indicator, wait for it to disappear. If an animation is expected, wait for the application’s relevant completion state rather than guessing how long the animation takes. A fixed delay can happen to work locally and fail under a different machine load or network condition.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Scroll, then find the element again

Scrolling can bring a control into view, but it can also trigger sticky headers, lazy-loaded content, or a re-render. If you scroll programmatically, perform the scroll before the final lookup and wait for any resulting transition. Then locate the target again immediately before interacting. This is especially important when the component is replaced during scrolling or rendering.

Validate the locator

  • Confirm the locator identifies the intended control in the current page state.
  • Check whether it can match multiple elements, including hidden duplicates.
  • Prefer stable attributes that identify the control rather than a fragile position in the DOM.
  • If the page re-renders, discard the prior WebElement and locate the replacement.

Selenium’s troubleshooting guidance recommends checking page state, locators, and waiting strategy rather than treating every failed click as a driver defect: Understanding Common Errors.

Replace sleeps with conditions, not longer sleeps

A time.sleep() call delays the next command but does not establish that the button is visible, that a banner is gone, or that a re-render has finished. A longer delay may conceal the race temporarily while slowing every passing test. Use a condition tied to the application state: target clickable, blocker invisible, expected result present, or updated element available. Selenium explains the synchronization problem and wait strategies in Waiting Strategies.

Keep waits purposeful. Waiting for an unrelated page-wide condition can add time without making the click safer. Avoid stacking arbitrary sleeps around explicit waits unless the application has a specific, documented reason that cannot be expressed as a condition.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check that Selenium and EdgeDriver match current Edge

For Chromium-based Microsoft Edge automation, use Microsoft Edge, Microsoft Edge WebDriver, and Selenium 4. Microsoft says Selenium 3 is no longer supported for this setup and documents its supported Selenium configuration at Use WebDriver to automate Microsoft Edge. Do not substitute the legacy Microsoft WebDriver for EdgeHTML; it is for the older EdgeHTML browser, not current Chromium Edge: Microsoft Edge WebDriver.

Confirm which Edge channel is installed and use the Chromium EdgeDriver appropriate to it. If the browser or driver has recently changed, verify the versions and driver type before changing application waits. Microsoft’s setup details are in its Chromium Edge WebDriver documentation.

Capture EdgeDriver logs and failure context

When the failure cannot be reproduced reliably, save diagnostics from the same run as the exception. Microsoft documents verbose EdgeDriver logging through EdgeDriverService and service arguments, including Python examples, in Use WebDriver to automate Microsoft Edge.

Pair the driver log with a screenshot, the failing URL, the locator, viewport dimensions, and the exception. Together, these can show whether the target was absent, covered, replaced, or never reached. Keep the evidence from the failing moment; a screenshot taken after the test has moved on may no longer show the cause.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting by symptom

Symptom Likely cause What to do
ElementClickInterceptedException Another element covers or overlaps the target. Inspect the failure screenshot; wait for the known overlay to disappear or the animation to finish, then click.
StaleElementReferenceException The DOM node was replaced after it was located. Wait for the updated state and find a fresh WebElement immediately before interaction.
Fails mostly on slower runs The test acts before JavaScript rendering or a transition is complete. Replace a fixed sleep with an explicit wait for the relevant application state.
Clicks the wrong control or a hidden one The locator matches a duplicate or unintended nested node. Inspect matches and page state; use a locator that identifies the intended control.
Failures began after a browser or driver change The driver type or version may not match Chromium Edge. Check the installed Edge channel, use the corresponding Chromium EdgeDriver, and use Selenium 4.
Cause remains unclear The failure evidence is incomplete or captured too late. Enable verbose EdgeDriver logging and save the URL, locator, viewport, exception, and screenshot together.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep the click user-like; do not hide the failure

It can be tempting to work around interception by invoking JavaScript to call click() on the node. That bypasses the normal pointer hit test and can make the test pass without fixing the page state a user would encounter. Prefer waiting for the blocker to disappear and using Selenium’s regular click. Use a different interaction only when the test is intentionally verifying that specific non-pointer behavior.

Or skip the browser setup

If your task is to capture a page image or PDF rather than test a real user interaction, ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return PNG, JPEG, WebP, or PDF. For example, this cURL request captures a page as WebP:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for the request options. Cookie banners, newsletter popups, and chat widgets can be removed before capture; those cleanup steps can each be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.

Frequently Asked Questions

Does WebDriverWait guarantee that no overlay can cover a button?

No. It checks the condition requested, such as visibility and enabled state. Wait separately for a known blocker to disappear.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I use Selenium’s JavaScript click as the permanent fix?

Not for an ordinary user-click test: it bypasses pointer hit-testing and can conceal an obstruction that users would encounter.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.