测试积点老人 发表于 2021-3-4 10:16:35

求助为何会报 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;
}报错如下:

我先等待元素存在再去查找元素,为何还是找不到该元素

qqq911 发表于 2021-3-5 10:36:43

没有定位到元素

郭小贱 发表于 2021-3-5 14:12:48

no such element: Unable to locate element...提示你没有定位到这个元素了
页: [1]
查看完整版本: 求助为何会报 no such element: ?