[Solved-5 Solutions] Debugging “Element is not clickable at point” error



Error Description:

    The full error message reads:

    • "org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675). Other element would receive the click: ..."
    • The element that 'would receive the click' is to the side of the element in question, not on top of it and not overlapping it, not moving around the page.

    Solution 1:

      • The element is not visible to click.
      • Use Actions or JavascriptExecutor for making it to click.

      By Actions:

      WebElement element = driver.findElement(By("element_path"));
      
      Actions actions = new Actions(driver);
      
      actions.moveToElement(element).click().perform();
      
      click below button to copy the code. By - google chrome tutorial - team

      By JavascriptExecutor:

      JavascriptExecutor jse = (JavascriptExecutor)driver;
      
      jse.executeScript("scroll(250, 0)"); // if the element is on top.
      
      jse.executeScript("scroll(0, 250)"); // if the element is on bottom.
      
      click below button to copy the code. By - google chrome tutorial - team

      or

      JavascriptExecutor jse = (JavascriptExecutor)driver;
      
      jse.executeScript("arguments[0].scrollIntoView()", Webelement); 
      
      click below button to copy the code. By - google chrome tutorial - team

      Then click on the element.

      Solution 2:

        • The page is getting refreshed before it is clicking the element.
        • For this, make the page to wait for few seconds.

        Solution 3:

          • The element is clickable but there is a spinner/overlay on top of it

          The below code will wait until the overlay disppears

          By loadingImage = By.id("loading image ID");
          
          WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
          
          wait.until(ExpectedConditions.invisibilityOfElementLocated(loadingImage));
          
          click below button to copy the code. By - google chrome tutorial - team

          Then click on the element.

          Solution 4:

            You can also use JavaScript click and scrolling would be not required then.

            IJavaScriptExecutor ex = (IJavaScriptExecutor)Driver;
            ex.ExecuteScript("arguments[0].click();", elementToClick);
            
            click below button to copy the code. By - google chrome tutorial - team

            Solution 5:

              Use this:

              JavascriptExecutor js = (JavascriptExecutor) driver;
              js.executeScript("var evt = document.createEvent('MouseEvents');" + "evt.initMouseEvent('click',true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0,null);" + "arguments[0].dispatchEvent(evt);", findElement(element));
              
              click below button to copy the code. By - google chrome tutorial - team

              Related Searches to Debugging “Element is not clickable at point” error