• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Programming Languages
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
  • Automation Tools and Different Tools
    • Web Automation
      • Selenium with Java
        • Selenium Basic
        • Selenium Advance
        • Selenium Realtime
        • Framework
        • Selenium Interview
        • Selenium Videos
        • Selenium with Docker
      • Selenium with Python
      • WebdriverIO
        • Selenium Webdriver C# Tutorial
      • Cypress
      • Playwright
    • TestNG
    • Cucumber
    • Mobile Automation
      • Appium
    • API Testing
      • Postman
      • Rest Assured
      • SOAPUI
    • testRigor
    • Katalon
    • TestProject
    • Serenity BDD
    • Gradle- Build Tool
    • RPA-UiPath
    • Protractor
    • Windows Automation
  • Automation For Manual Testers
  • Services
  • Online Training
  • Contact us
  • About me
  • Follow us
    • Linkedin
    • Facebook Group
    • Facebook Page
    • Instagram

Automation

Selenium WebDriver tutorial Step by Step

You are here: Home / Advance Selenium / How to solve Element is not clickable at point in Selenium

How to solve Element is not clickable at point in Selenium

May 22, 2015 by Mukesh Otwani 58 Comments

element is not clickable at point(x,y)

I was very happy when I was working with Firefox on Windows, but in my organization, I came across through a requirement where I had to execute test case mainly on Chrome browser. I faced Element is not clickable at point in Selenium and I solved using different ways.

If you want to start working with chrome then check below post to see how to work with Chrome browser.

How to execute Selenium Testcase in Chrome browser

Element is not clickable at point in Selenium

 

I started automating test case and most of the test cases was working fine, but some of the test cases were failing due to below exception.

 

Element is not clickable at point in Selenium

I have seen a couple of exception while working with Selenium but this was a new exception for me so I was not sure how to solve this.

I have collected some of frequent occurring exception in Selenium, which might help you.

Different Scenario of Selenium Exception

I started debugging my test cases, tried so many hit and trial, and finally found some of the solutions so thought will share with others too.

 

The reason for the element is not clickable at point(x,y) exception.

Some of my observation was

  • It mostly happens in Chrome so if you are mostly working with Firefox or IE then you will not be getting this exception.
  • Chrome does not calculate the exact location of element
  • Chrome always click in the middle of Element.
  • Sometimes you will get this exception due to Sync issue also.

 

YouTube Video for same 

 

Solution that worked for me to Solve element is not clickable at point(x,y) exception

1-Updated chrome driver to latest one 2.15

2-Get the coordinate then click on the link or button

3-Try to click using Y coordinates

// Find an element

WebElement elementToClick = driver.findElement(By.xpath("Your xpath"));



// Scroll the browser to the element's Y position

((JavascriptExecutor)driver).executeScript("window.scrollTo(0,"+elementToClick.getLocation().y+")");



// Click the element

elementToClick.click();

 

4-Try to click using X coordinates

 

// Find an element

WebElement elementToClick = driver.findElement(By.xpath("Your xpath"));



// Scroll the browser to the element's X position

((JavascriptExecutor)driver).executeScript("window.scrollTo(0,"+elementToClick.getLocation().x+")");



// Click the element

elementToClick.click();

 

Selenium has a large number of option to handle single thing in multiple ways so in case you are facing any issue feel free to reach out. Comment below for any suggestion and feedback.

Keep visiting, have a nice day J

For More updates Learn Automation page

For any query join Selenium group- Selenium Group

 

Filed Under: Advance Selenium Tagged With: element is not clickable at point(x, y)

Reader Interactions

Comments

  1. Shristi says

    September 27, 2021 at 9:33 AM

    Hi Mukesh,
    On the URL, http://demo.automationtesting.in/Register.html , I want to click on “choose file ” option , but I’m not able to do so even using JavaScript.
    Can you please help.

    Reply
    • Mukesh Otwani says

      October 1, 2021 at 5:37 PM

      Hi Shristi,

      If you inspect Choose File element, then you would be <input tag along with type='file' and this attribute allows you to upload files without clicking on Choose File button. You can use this statement driver.findElement(By.xpath("//*[@id='imagesrc']")).sendKeys("your_file_path");
      Please refer initial part of this link https://learn-automation.com/upload-file-in-selenium-webdriver-using-robot-class/

      Reply
  2. Siddesha B B says

    August 7, 2021 at 7:39 AM

    hii Mukesh ,
    pls give me code to click of More Options: Class of Travel,Airline Preference of given url https://www.cleartrip.com/ . Tried many ways but not able to click.

    Thanks in advance

    Reply
    • Mukesh Otwani says

      August 8, 2021 at 12:03 PM

      Hi Siddesha,
      Xpath ->> //*[local-name()=’strong’ and text()=’More options:’] worked for me.

      Reply
  3. Rajatha says

    August 29, 2019 at 11:28 AM

    Thank you so much Mukesh. Above solution worked for me.

    Reply
    • Mukesh Otwani says

      August 29, 2019 at 1:26 PM

      Cheers Rajatha

      Reply
  4. Sheetal says

    June 18, 2019 at 12:11 PM

    hii pls give me code to click of Signin button of given url (https://dayswappers.org/login)
    as i tried with many codes

    Reply
    • Mukesh Otwani says

      June 23, 2019 at 11:17 PM

      Hi Sheetal,

      I’ve tried with xpath //button[text()=’Sign In’] and it worked well.

      Reply
  5. Perron Firmin says

    May 3, 2019 at 9:57 PM

    Hello Dear Mukesh,
    I hope you are well. I sent you a message by your E-mail about the last suggestion.

    Thanks in advance,

    Perron,

    Reply
    • Mukesh Otwani says

      May 6, 2019 at 5:00 PM

      Hi Perron,

      I could not find any email. Let’s have a call for quick discussion.

      Thanks
      Mukesh Otwani

      Reply
  6. Perron Firmin says

    April 30, 2019 at 10:11 PM

    Hello dear Mukesh,

    Many thanks for your response. I sent you an e-mail. But I would like to write the code to manage next page click.

    I see this program that makes the same things I want to make :

    def scrape():
    driver = webdriver.PhantomJS()
    driver.get(‘http://quotes.toscrape.com/js-onclick’)
    while True:
    sel = parsel.Selector(text=driver.page_source)
    for quote in sel.css(‘div.quote’):
    print({
    ‘text’: quote.css(‘span.text::text’).extract_first(),
    ‘author’: quote.css(‘span small::text’).extract_first(),
    ‘tags’: quote.css(‘div.tags a.tag::text’).extract(),
    })
    try:
    next_button = driver.find_element_by_css_selector(‘li.next > a’)
    next_button.click()
    except NoSuchElementException:
    break

    When I make inspect on this URL, I get the following code for next button :

    Next →

    for my context, I don’t know how to select the element for the next page button click. You can see my code after inspect on my URL.


    ›
    Page suivante

    PLEASE, help me to fix this.

    Many thanks,

    Reply
    • Mukesh Otwani says

      May 1, 2019 at 12:59 PM

      Hi Perron,

      Please try below xpath

      //li[@class=’next’]//a
      //li[@class=’next’]

      If above xpath is not working then we can try JavaScriptExecutor

      Reply
  7. Mukesh Otwani says

    April 25, 2019 at 2:55 PM

    Sure Perron you can mail me your queries at mukeshotwani@learn-automation.com

    Reply
  8. Gaurav Khurana says

    February 20, 2017 at 11:46 AM

    I also got this problem . But it got solved by just maximizing the window. Sometimes that also works.

    Reply
    • Mukesh Otwani says

      February 20, 2017 at 1:33 PM

      Thanks Gaurav I will update this as well.

      Reply
  9. Soheil says

    January 5, 2017 at 5:42 PM

    hi Mukesh,

    i have tried sooo many things but cannot continue as i am getting the error ” is not clickable at point (1811, 300). Other element would receive the click:…”

    i have tried with:
    1. add implicit wait (implicitlyWait(timeout, TimeUnit.SECONDS);
    2. use action with offset
    3. use javascriptexecutor with offset (scroll-to)
    4. execute java script with javascriptexecutor (executeScript(“document.getElementByxpath)

    only way it worked was (but not permanentely)
    – ((JavascriptExecutor) webDriver).executeScript(“document.getElementById(‘unique ID of MYBUTTON’).click();”);
    – my button does not have id. i added ID during runtime in chrome inspector (F12)

    could you please help me? Invensting now 2 days cannot continue with all solutions.

    Reply
    • Mukesh Otwani says

      January 10, 2017 at 9:47 AM

      Hi Soheil,

      Try with dynamic xpath. Each application contains its own library for different controls. Locate parent or child tags and do same operation.

      Reply
      • Soheil says

        January 10, 2017 at 1:23 PM

        Hello Mukesh,

        thanks for your response. with dynamic xpath you mean something like this, right:
        webDriver.findElement(By.xpath(“//*[@class=’xxclass Tagxx of MYBUTTON’]”)).click();

        I have used the inspector in Chrome to locate the parent tags and also tried to click on them but no outcome. my element does not have an ID and i cannot influence the implementation.

        Is there a way to click on an Element through javascriptexecutor to a control which has not an ID? I mean using javascriptexecutor with an xpath?

        Because this worked: I defined during runtime (in debug mode) an ID to the control with the chrome inspector and this line:

        ((JavascriptExecutor) webDriver).executeScript(“document.getElementById(‘test’).click();”);

        I tried with this and it says: no such function named getelementbyxpath.

        StringBuffer javaScript=new StringBuffer();
        javaScript.append(“document.getElementByxpath(“”);
        javaScript.append(“/html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div[1]/ul/li/catalog-product/div/div[2]/div[1]/div”);
        javaScript.append(“”).click();”);
        JavascriptExecutor executor = (JavascriptExecutor)webDriver;
        String javaScriptText = javaScript.toString();
        executor.executeScript(javaScriptText);

        Hope i am not providing tooo much information and confuse…

        thanks so far.
        bye
        Mohammad

        Reply
        • Mukesh Otwani says

          January 10, 2017 at 2:57 PM

          Hi Soheil,

          Try this
          WebElement elem = webDriver.findElement(By.xpath(xpath));
          String js = “arguments[0].style.height=’auto’; arguments[0].style.visibility=’visible’;”;
          ((JavascriptExecutor)ldriver).executeScript(js, elem);
          elem.click();
          ElementHighlight.higtLight(ldriver, lxpath);

          Reply
          • Soheil says

            January 10, 2017 at 6:57 PM

            Hi Mukesh,

            really appreciate your help. Thanks!

            with this below i get an exception:

            WebElement elem = webDriver.findElement(By.xpath( “//*[@class=’ng-binding’]”));
            String script = “arguments[0].style.height=’auto’; arguments[0].style.visibility=’visible’;”;
            ((JavascriptExecutor)webDriver).executeScript(script, elem);
            clickableAddProduct.click();

            Exception message: unknown error: Runtime.evaluate threw exception: SyntaxError: Invalid or unexpected token
            at line 3 (JavaScriptExecutor line)

          • Mukesh Otwani says

            January 10, 2017 at 7:35 PM

            Hi Soheil,

            Call elem.click() instead clickableAddproduct.click();

  10. Raveendra says

    December 1, 2016 at 5:18 PM

    Hi Mukesh,

    Hope you are doing Great,

    Thanks for sharing Your knowledge with us,

    I am following Your selenium videos its Really nice and clear&Well Explained Each and every point

    I am NEW to selenium so,

    I have a Question

    Can we perform KeyBoard API (like downloading a file by using TAB operations) using PageObjectModel, i am able performing the DROPDOWNS so i just want to confirm weather we can r not,

    Thanks&Regards,
    Raveendra

    Reply
    • Mukesh Otwani says

      December 6, 2016 at 12:38 PM

      Hi Raveendra this will guide http://learn-automation.com/selenium-advance-activity/

      Reply
  11. Akash says

    November 7, 2016 at 6:35 PM

    Hi mukesh, facing same issue Element is not clickable at point (514.5, 11.866668701171875). Other element would receive the click: . please reply to resolve, i have send you my script one week ago Awaiting for your reply.

    Reply
    • Mukesh Otwani says

      November 30, 2016 at 7:57 PM

      Hi Akash,

      I have video for this https://www.youtube.com/watch?v=XNwcGNLk3cE&t=1s

      Reply
      • priya says

        December 3, 2016 at 11:56 AM

        Hi,
        I use the same code to click on one button after clicking it should open the form, its not opening the form and also its not throwing any error, how to solve such problem

        Reply
        • Mukesh Otwani says

          December 6, 2016 at 12:27 PM

          Hi Priya,

          Please try in different browsers.

          Reply
  12. surjit singh says

    November 2, 2016 at 7:28 PM

    I also faced the same issue.
    I downgraded selenium jar to 2.46 and this issue was gone.

    Reply
    • Mukesh Otwani says

      November 4, 2016 at 1:50 AM

      Great Surjit

      Reply
  13. Anju says

    October 20, 2016 at 3:44 PM

    Hi Mukesh,

    I am new to Selenium in learning stage,i found most of your post helpful but stucked in the following exception.I tried all the possibilities suggested by you, still not able to click on calender to select the date.

    I am sharing my code, pls help

    WebElement elementToClick = driver.findElement(By.xpath(“.//*[@id=’vfb-8′”));
    ((JavascriptExecutor)driver).executeScript(“window.scrollTo(0,”+elementToClick.getLocation().x+”)”);
    elementToClick.click();

    I am using Google Chrome version 54.0.2840.59

    Reply
    • Mukesh Otwani says

      October 20, 2016 at 5:37 PM

      Hi Anju,

      Can you share your scripts as well?

      Reply
  14. Rekha says

    October 13, 2016 at 8:04 PM

    Hi Mukesh, I am encountering the same error = System.InvalidOperationException : unknown error: Element is not clickable at point (752, 237).

    when I click on a link in Chrome browser. Can you please let me know the IJavaScriptExecutor syntax for the same in C#

    Reply
    • Mukesh Otwani says

      October 13, 2016 at 11:44 PM

      HI Rekha,

      Sorry I am not good in c# but I can give you suggestion that try some other xpath which will match with single node.

      Reply
  15. prashant jha says

    September 5, 2016 at 12:18 PM

    Sir, I am getting the error ” Element is not clickable at point (958, 7) in firefox ” Sometime it is working and sometime it is showing the above .can you give me the solution how to fix it?

    Reply
    • Mukesh Otwani says

      September 5, 2016 at 12:31 PM

      Hi Prashant,

      It mostly happens when click method is not clicking on middle of element. Can you send me ur code to my email so that I can check mukeshotwani@learn-automation.com

      Reply
  16. Bimlesh says

    August 21, 2016 at 4:59 PM

    Hi Mukesh,

    Kindly advise on this issue.

    Scenario: Login successfully to http://www.homeshop18.com and then choose “Samsung” from “Digital” Menu. The results are displayed and now from the “Brand” section (displayed at the left side of the page), I need to choose another brand called “Micromax” by SROLLING.

    I am trying to achieve this but no luck so far.

    My code:

    public void Browse_Samsung() throws Exception
    {
    WebDriverWait wait = new WebDriverWait(driver, 30);
    Actions act = new Actions(driver);
    act.moveToElement(Digital_Menu).perform();
    act.click(wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“//*[@id=’CategoryMenu1′]//a[@title=’Samsung’]”)))).build().perform();

    WebElement Micromax = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“//*[@id=’filter_1Option_21′]//a[@title=’GSM Mobile Phones – Micromax’]”)));

    ((JavascriptExecutor)driver).executeScript(“window.scrollTo(0,”+Micromax.getLocation().x+”)”);

    Micromax.click();

    }

    Error:

    org.openqa.selenium.TimeoutException: Timed out after 30 seconds waiting for visibility of element located by By.xpath: //*[@id=’filter_1Option_21′]//a[@title=’GSM Mobile Phones – Micromax’]
    Build info: version: ‘2.53.1’, revision: ‘a36b8b1cd5757287168e54b817830adce9b0158d’, time: ‘2016-06-30 19:26:09’

    Reply
    • Mukesh Otwani says

      August 27, 2016 at 11:30 PM

      Hi Bimlesh,

      Can u send me complete program which will help me to fix this issue.

      Reply
  17. Manasi says

    July 22, 2016 at 11:35 AM

    I am facing the same issue in FF, but only when I am using xpath. It works fine when I am using the link text.

    Reply
    • Mukesh Otwani says

      July 25, 2016 at 12:15 PM

      Hey Manasi,

      Thanks and good observation 🙂 Have you tried proposed solution which I mentioned in my blog?

      Reply
  18. shruthi says

    June 26, 2016 at 7:31 PM

    Hi Mukesh,

    Really your code helped me.I am trying to solve my problem from 2 days.but couldn’t do it.

    Thankyou so much.I am just beginner.Could you please explain me why we should use Java script in that code?

    Reply
    • Mukesh Otwani says

      July 2, 2016 at 3:11 PM

      Hey Shruthi,

      Java Script can forcefully click on Specific element which java can not do 🙂

      Reply
  19. Zaher says

    April 21, 2016 at 2:54 PM

    I have had this problem on FF. This issue happens when your field is not in the view area. The slick way to resolve this issue is to zoom out your browser:

    TheNotClickableField.SendKeys(Keys.Control + “-” + “-“);

    you might want to zoom out more or less according to your page size.

    Reply
    • Mukesh Otwani says

      April 21, 2016 at 8:14 PM

      Thanks Zaher 🙂

      Reply
  20. Hemant says

    March 27, 2016 at 6:18 PM

    I’m facing same issue in Firefox 44.0.2. Our Python automation is not able to click on the “Give Away” button to test the giveaway page of goodreads.com. Please Help.

    Reply
    • Mukesh Otwani says

      March 27, 2016 at 8:50 PM

      Hi Hemant,

      First perform mouse hover and then click on Button. This solution always worked for me.

      Reply
  21. Guna says

    March 17, 2016 at 2:34 PM

    Hey I am unable to click on button in firefox but if try to click manually it is working but with selenium it showing below error
    lement is not clickable at point (1100, 22). Other element would receive the click.
    i have tried y coordinates thing but it doesn’t work. Please help me on this.

    Reply
    • Mukesh Otwani says

      March 20, 2016 at 7:45 PM

      Hi Guna,

      MoveToElement approach always works for me 🙂

      Reply
  22. Alex says

    March 11, 2016 at 7:34 PM

    Thanks, this article helped me out!

    Reply
  23. Deepak says

    February 16, 2016 at 4:39 PM

    Hey I am unable to click on button in firefox but if try to click manually it is working but with selenium it showing below error
    lement is not clickable at point (77, 590). Other element would receive the click.

    i have tried the x and y coordinates thing. Please help me on this.

    Reply
    • Mukesh Otwani says

      February 22, 2016 at 5:19 PM

      Is this solved?

      Reply
  24. Łukasz says

    January 29, 2016 at 4:47 PM

    Everywhere it is written that this issue occurs only in Chrome. I use Firefox and I also had this problem. But your solution helped me. Thx a lot 🙂

    Reply
    • Mukesh Otwani says

      March 3, 2016 at 4:29 PM

      Hi Lukasz,

      Glad to know it worked for you. Cheers

      Reply
  25. Rafael Carvalho says

    January 19, 2016 at 6:55 AM

    Hello,

    I was having problem running my UI tests inside a windows service application (Bamboo Server), and now after doing what you suggested everything is working good!

    Many thanks!!!

    (I am using Firefox driver)

    Reply
    • Mukesh Otwani says

      January 20, 2016 at 1:08 AM

      Hi Rafael Carvalho,

      Glad to hear it helped you. Keep visiting 🙂

      Reply
  26. Janet Frank says

    December 30, 2015 at 9:29 PM

    I am also having this issue. I am using Java but when I add the JavaScriptExecutor to my code I do not get the method executeScript added. I am not sure what is happening here. As stated above my code us working fine for Firefox and Edge.

    Reply
    • Mukesh Otwani says

      January 2, 2016 at 10:48 PM

      Hi Janet,

      Please make sure JavaScriptExecutor which you imported is coming from Selenium library or not?

      If not then please import the correct package and try again.

      Let me know if still facing the same issue then I will login and fix this.

      Reply
  27. G Derilus says

    December 16, 2015 at 9:58 PM

    Hey with Selenium 2.48.2 release firefox is acting the save way can you update this article – This very useful article! thank you!

    Reply
    • Mukesh Otwani says

      December 17, 2015 at 8:43 PM

      Hi Derilus,

      Thanks for keep me updated. I will update the article too 🙂

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Free Selenium Videos

https://www.youtube.com/watch?v=w_iPCT1ETO4

Search topic

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?

Stay connected via Facebook

Stay connected via Facebook

Archives

Footer

Categories

Recent Post

  • Syllabus For Playwright Online Training Program
  • API Testing Using Postman And RestAssured
  • Disable Personalise Your Web Experience Microsoft Edge Prompt In Selenium
  • How To Fix Error: No tests found In Playwright
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?