-1

Exception in thread "main" org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element ... is not clickable at point (1075, 323). Other element would receive the click: (Session info: chrome=79.0.3945.130)

How to solve this error for selenium webdriver code..FOR CLICKING THE POST BUTTON using xpath the devloperr donot provide id for that button CODE:

WebElement element1=driver.findElement(By.xpath("//*[@id=\"SINPost\"]/button")); element1.click(); 
0

    1 Answer 1

    1

    If you are using chrome it can happen sometimes, because chrome always tries to click at the middle of the element. What you can do is use JavaScriptExecutor interface of selenium. The code should look like this

    JavascriptExecutor js = (JavascriptExecutor) DriverManager.getWebDriver(); js.executeScript("arguments[0].click();", element);

    6
    • Exception in thread "main" java.lang.ClassCastException: java.util.Vector$1 cannot be cast to org.openqa.selenium.JavascriptExecutor at demo.iNetwork_tab.main(iNetwork_tab.java:41) after adding above command I got this error and also it not take .getwebdriver method
      – vaidehi
      CommentedFeb 12, 2020 at 10:52
    • Hey, @vaidehi .getdriver is my custom method which returns me the webdriver. So in place of DriverManager.getWebDriver(); Please pass your webdriver.CommentedFeb 13, 2020 at 7:11
    • this also not working I tried to create custom path but that thing also not working to lalocate the button
      – vaidehi
      CommentedFeb 17, 2020 at 7:24
    • the element will not locate error continuously arrived, the button inspect only div id, class and button one click gave ..
      – vaidehi
      CommentedFeb 26, 2020 at 12:04
    • I tried it by XPath, custom XPath, using javascript executor CSS locator by all ways it cant works
      – vaidehi
      CommentedFeb 26, 2020 at 12:06

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.