Debugging “Element is not clickable at point” error

后端 未结 30 2170
余生分开走
余生分开走 2020-11-21 23:55

I see this only in Chrome.

The full error message reads:

\"org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675

30条回答
  •  無奈伤痛
    2020-11-22 00:24

    You need to use focus or scroll on that element. You also might have to use explict wait.

    WebElement firstbutton= driver.findElement(By.xpath("Your Element"));
    Actions actions = new Actions(driver);
    actions.moveToElement(element);
    actions.perform();
    

    OR

    The element is not clickable because of a Spinner/Overlay on top of it:

    By loadingImage = By.id("loading image ID");
    WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
    wait.until(ExpectedConditions.invisibilityOfElementLocated(loadingImage));
    

    OR

    Point p= element.getLocation();
    Actions actions = new Actions(driver);
    actions.moveToElement(element).movebyoffset(p.x,p.y).click().perform();
    

    OR

    If still not work use JavascriptExecutor

    JavascriptExecutor executor = (JavascriptExecutor)driver;
    executor.executeScript("arguments[0].click();", firstbutton);
    

提交回复
热议问题