- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Selenium Exception Error - Element is not clickable at point (x,y). Other element would receive the click
We may encounter the Selenium Exception Error - Element is not clickable at point(x,y). Other element would receive the click while working Selenium webdriver.
This is normally seen while executing Selenium tests from the Chrome browser and not with other browsers like IE and Firefox. This happens because the Chrome browser could not compute the correct location of a webelement.
Besides, in the Chrome browser, an element is clicked in its middle position. This exception can also be encountered owing to synchronization issues happening between the application and Selenium.
There exists some solutions to fix this issue as listed below −
We should ensure that we are using the latest version of the chromedriver and it is compatible with the Chrome browser version we have in our local system.
Obtain the coordinates of a webelement and then perform click on it using methods in Actions class.
Syntax
WebElement elm = driver.findElement(By.tagName("input")); //instance of Point class Point location = elm.getLocation(); //get x, y coordinates int m = location.getX(); int n = location.getY(); //instance of Actions class Actions a = new Actions(driver); a.moveToElement(elm,m,n).click().build().perform();
Obtain the coordinates of a webelement and click it using JavaScript Executor.
Syntax to get x-coordinate −
WebElement l = driver.findElement(By.tagName("input")); JavascriptExecutor j =(JavascriptExecutor)driver; j.executeScript( "window.scrollTo(0,"l.getLocation().x+")"); l.click();
Syntax to get y-coordinate −
WebElement l = driver.findElement(By.tagName("input")); JavascriptExecutor j =(JavascriptExecutor)driver; "window.scrollTo(0,"l.getLocation().y+")"); l.click();
- Related Articles
- Selenium - Element is not clickable at point
- Getting this error: "Element is not clickable at point"
- Check that the element is clickable or not in Selenium WebDriver
- How to resolve exception Element Not Interactable Exception in Selenium?
- Find and click element by title Python Selenium.
- How to click on hidden element in Selenium WebDriver?
- Which exception is raised when an element is not found in an HTML DOM using XPath in Selenium?
- How to use JavaScript in Selenium to click an Element?
- How to perform double click on an element in Selenium?
- How do you click on an element which is hidden using Selenium WebDriver?
- How to Resolve Stale Element Reference Exception in Selenium WebDriver?
- What is Stale Element Reference Exception in Selenium Webdriver & How To Fix It?
- How to perform double click on an element in Selenium with python?
- How to perform right click on an element in Selenium with python?
- How to perform right click on an element with Actions in Selenium?
