ElementNotInteractableException,Element could not be scrolled into view

在使用webdriver处理表格的时候,点击tr标签。可能会遇到ElementNotInteractableException,Element could not be scrolled into view错误

 

 

 

参考解决方法:

1、 元素点击前,加等待

try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

2. 使用action的方式点击元素

@Override
public void clickElementByAction(WebElement element) {
        Actions actions = new Actions(driver);
        actions.moveToElement(element).click().perform();
}

 

posted @ 2020-09-22 17:27  Lozz  阅读(1110)  评论(0编辑  收藏  举报