selenium中解决Element is not clickable at point...

报错:

unknown error: Element

...
is not clickable at point (1120, 85). Other element would receive the click:
...

这个是由于页面跳转时正在加载页面,点击到其他元素了,需要加一些等待时间,有三种方法加等待时间
(参考:https://blog.csdn.net/rookie_hh/article/details/78517271)

1、强制等待1秒

Thread.sleep(1000)

2、隐式等待

driver.manage().timeouts().implicitlyWait(2000, TimeUnit.SECONDS);

3、显式等待

WebDriverWait wait=new WebDriverWait(driver, 10);
WebElement wl= wait.until(new ExpectedCondition() {
@Override
publicWebElement apply(WebDriver d) {
returnd.findElement(By.cssSelector(".red_box"));
}
});

你可能感兴趣的:(selenium中解决Element is not clickable at point...)