Selenium - Element is not clickable at point

后端 未结 7 1295
无人共我
无人共我 2020-12-30 06:30

I am using selenium for test script. I am getting following error and this error randomly occur. When I run 10 times, I get this about twice. So it\'s not really reproducibl

7条回答
  •  有刺的猬
    2020-12-30 06:38

    I have solved by catching the exception and managing it like this:

            WebDriver driver = new ChromeDriver();
            WebElement element = driver.findElement(By.id("ID"));
            boolean clicked = false;
            do{
                try {
                    element.click();
                } catch (WebDriverException e) {
                    continue;
                } finally {
                    clicked = true;
                }
            } while (!clicked);
    

提交回复
热议问题