Selenium Web Driver & Java. Element is not clickable at point (x, y). Other element would receive the click

前端 未结 8 1453
北恋
北恋 2020-11-21 04:08

I used explicit waits and I have the warning:

org.openqa.selenium.WebDriverException: Element is not clickable at point (36, 72). Other element wou

相关标签:
8条回答
  • 2020-11-21 05:04

    You can try

    WebElement navigationPageButton = (new WebDriverWait(driver, 10))
     .until(ExpectedConditions.presenceOfElementLocated(By.id("navigationPageButton")));
    navigationPageButton.click();
    
    0 讨论(0)
  • 2020-11-21 05:07

    The best solution is to override the click functionality:

    public void _click(WebElement element){
        boolean flag = false;
        while(true) {
            try{
                element.click();
                flag=true;
            }
            catch (Exception e){
                flag = false;
            }
            if(flag)
            {
                try{
                    element.click();
                }
                catch (Exception e){
                    System.out.printf("Element: " +element+ " has beed clicked, Selenium exception triggered: " + e.getMessage());
                }
                break;
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题