求助为何会报 no such element: ?
求助为何会报 no such element: Unable to locate element: {"method":"css selector","selector":""} 错误代码:
public WebElement findElement(By by){
if (!waitEle(by)){
throw new RuntimeException("cannot find ele : " + by);
}
return webElement.findElement(by);
}private Boolean waitEle(By by) {
if (by == null){
return false;
}
WebDriverWait wait = new WebDriverWait(driver, waitTimeDefault);
try {
wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(by));
} catch (Exception e) {
return false;
}
return true;
}报错如下:
我先等待元素存在再去查找元素,为何还是找不到该元素
没有定位到元素 no such element: Unable to locate element...提示你没有定位到这个元素了
页:
[1]