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

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();
}

 

相关文章:

  • 2021-04-25
  • 2021-12-18
  • 2022-12-23
  • 2022-01-12
  • 2021-10-25
  • 2021-05-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-07-09
  • 2022-01-08
  • 2021-09-11
相关资源
相似解决方案