How to Fix Selenium's "Element Is Not Clickable at Point"
Last Updated :
23 Jul, 2025
When automating web applications with Selenium WebDriver, you may encounter various exceptions that can halt your tests. One common issue that many testers face is the "Element is not clickable at point" exception. This error can be frustrating, especially when you're trying to interact with an element that seems perfectly clickable.
In this article, we'll dive deep into understanding what this exception means, the causes behind it, and how to fix it effectively. By the end, you'll be equipped with practical solutions to overcome this challenge and ensure smoother test executions
What is the "Element Is Not Clickable at Point" exception?
What is the "Element is not clickable at point" Exception?
The "Element is not clickable at point" exception in Selenium WebDriver occurs when Selenium tries to click on an element, but something obstructs the click action, such as another element overlaying it. The exception message usually looks something like this:
org.openqa.selenium.ElementClickInterceptedException: Element <element> is not clickable at point (x, y). Other element would receive the click.
This error indicates that although Selenium has located the element, it's unable to interact with it due to some obstruction
What Are the Causes of the "Element is not Clickable at Point" Exception?
Several factors can cause this exception, including:
- Overlapping Elements: Another element, such as a modal, dropdown, or advertisement, might be covering the clickable element.
- Loading Issues: The element might not be fully loaded or rendered on the page, causing Selenium to attempt a click prematurely.
- Dynamic Content: Pages with dynamic content may cause elements to shift positions, leading to the element being obstructed at the time of the click.
- Incorrect Element Coordinates: The WebDriver might be trying to click at incorrect coordinates due to scaling issues or incorrect element positioning.
How to Fix Selenium's "Element Is Not Clickable at Point"
Here are several methods to resolve this exception:
Wait for the Element to be Clickable
Use WebDriverWait
to wait until the element is clickable.
Java
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com/");
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement searchButton = wait.until(ExpectedConditions.elementToBeClickable(By.name("btnK")));
searchButton.click();
This ensures that Selenium waits until the element is in a clickable state before attempting to click it.
Sometimes, scrolling the element into view can help.
Java
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com/");
WebElement searchButton = driver.findElement(By.name("btnK"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", searchButton);
searchButton.click();
This script scrolls the element into view before clicking it.
Click Using JavaScript
If the issue persists, you can use JavaScript to perform the click action.
Java
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com/");
WebElement searchButton = driver.findElement(By.name("btnK"));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", searchButton);
This method bypasses the usual WebDriver click method and uses JavaScript to trigger the click event.
Handle Overlapping Elements
If an overlay or another element is causing the issue, you might need to close it or wait for it to disappear.
Java
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com/");
// Handle any potential overlay
try {
WebElement overlay = driver.findElement(By.className("overlay"));
if (overlay.isDisplayed()) {
overlay.click(); // Close the overlay if it's blocking the button
}
} catch (NoSuchElementException e) {
// No overlay present, continue
}
WebElement searchButton = driver.findElement(By.name("btnK"));
searchButton.click();
Reposition the Window
Sometimes resizing or repositioning the browser window can help.
Java
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com/");
driver.manage().window().setPosition(new Point(0, 0));
driver.manage().window().maximize();
WebElement searchButton = driver.findElement(By.name("btnK"));
searchButton.click();
This ensures that the browser is maximized and positioned correctly before interacting with the element.
Example:
Java
package com.selenium.example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.NoSuchElementException;
public class ClickableElementTest {
public static void main(String[] args) {
// Automatically setup ChromeDriver using WebDriverManager
WebDriverManager.chromedriver().setup();
// Initialize WebDriver
WebDriver driver = new ChromeDriver();
try {
// Open Google's homepage
driver.get("https://www.google.com/");
// Method 1: Wait for the page to load completely
Thread.sleep(3000); // Wait for 3 seconds to ensure the page is loaded
// Locate the search box and button
WebElement searchBox = driver.findElement(By.name("q")); // Google search box
WebElement searchButton = driver.findElement(By.name("btnK")); // Google Search button
// Method 2: Scroll the element into view
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", searchButton);
// Additional sleep to ensure the element is ready to be clicked
Thread.sleep(3000); // Wait for 3 seconds to ensure the element is interactable
// Enter text into the search box
searchBox.sendKeys("Selenium WebDriver");
// Method 3: Handle any potential overlay or modal
try {
// Example: Check if an overlay or modal might be blocking the button
// In this example, we assume there's no such overlay, but you might need to adjust if there's any.
// For Google, this is often not needed, but shown for completeness
WebElement overlay = driver.findElement(By.className("overlay")); // Adjust as necessary
if (overlay.isDisplayed()) {
overlay.click(); // Close the overlay if it's blocking the button
Thread.sleep(2000); // Wait for the overlay to close
}
} catch (NoSuchElementException e) {
// No overlay present, continue
}
// Method 4: Click using JavaScript if normal click fails
try {
searchButton.click(); // Attempt standard click
} catch (Exception e) {
// If the standard click fails, use JavaScript click
((JavascriptExecutor) driver).executeScript("arguments[0].click();", searchButton);
}
System.out.println("Search button clicked successfully!");
// Keep the browser open for a while to observe the result
Thread.sleep(10000); // Wait for 10 seconds
} catch (InterruptedException e) {
System.out.println("Thread interrupted: " + e.getMessage());
} catch (Exception e) {
e.printStackTrace();
} finally {
// Close the browser
driver.quit();
}
}
}
Output:
Search button clicked successfully!
Conclusion
The "Element is not clickable at point" exception in Selenium WebDriver can be a significant hurdle in test automation. However, by understanding the underlying causes and employing the appropriate solutions, you can effectively handle this issue. Whether it involves waiting for elements, handling overlays, using JavaScript clicks, or adjusting the browser window, these strategies will help you overcome this common challenge and ensure smoother test execution on websites.
By applying these techniques, you will enhance the reliability and robustness of your automated tests, leading to a more efficient and effective testing process.
Similar Reads
Software Testing Tutorial Software testing is an important part of the software development lifecycle that involves verifying and validating whether a software application works as expected. It ensures reliable, correct, secure, and high-performing software across web, mobile applications, cloud, and CI/CD pipelines in DevOp
10 min read
What is Software Testing? Software testing is an important process in the Software Development Lifecycle(SDLC). It involves verifying and validating that a Software Application is free of bugs, meets the technical requirements set by its Design and Development, and satisfies user requirements efficiently and effectively.Here
11 min read
Principles of Software testing - Software Testing Software testing is an important aspect of software development, ensuring that applications function correctly and meet user expectations. From test planning to execution, analysis and understanding these principles help testers in creating a more structured and focused approach to software testing,
3 min read
Software Development Life Cycle (SDLC) Software Development Life Cycle (SDLC) is a structured process that is used to design, develop, and test high-quality software. SDLC, or software development life cycle, is a methodology that defines the entire procedure of software development step-by-step. The goal of the SDLC life cycle model is
8 min read
Software Testing Life Cycle (STLC) The Software Testing Life Cycle (STLC) is a process that verifies whether the Software Quality meets the expectations or not. STLC is an important process that provides a simple approach to testing through the step-by-step process, which we are discussing here. Software Testing Life Cycle (STLC) is
7 min read
Types of Software Testing Software testing is a important aspect of software development life-cycle that ensures a product works correctly, meets user expectations, and is free of bugs. There are different types of software testing, each designed to validate specific aspects of an application, such as functionality, performa
15+ min read
Levels of Software Testing Software Testing is an important part of the Software Development Life Cycle which is help to verify the product is working as expected or not. In SDLC, we used different levels of testing to find bugs and errors. Here we are learning those Levels of Testing in detail.Table of ContentWhat Are the Le
4 min read
Test Maturity Model - Software Testing The Test Maturity Model (TMM) in software testing is a framework for assessing the software testing process to improve it. It is based on the Capability Maturity Model(CMM). It was first produced by the Illinois Institute of Technology to assess the maturity of the test processes and to provide targ
8 min read
SDLC MODELS
TYPES OF TESTING