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

前端 未结 8 1489
北恋
北恋 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: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;
            }
        }
    }
    

提交回复
热议问题