【问题标题】:WebDriverWait constructor giving error while declaring public staticWebDriverWait 构造函数在声明公共静态时给出错误
【发布时间】:2022-06-22 17:50:22
【问题描述】:

构造函数 WebDriverWait(WebDriver, int) 未定义

public static WebDriverWait wait = new WebDriverWait( driver, 20);

尝试用 public static 声明这个 WebDriverWait 它给出错误 在此之前我已经声明了 WebDriver 实例

公共静态 WebDriver 驱动程序;

【问题讨论】:

    标签: selenium-webdriver


    【解决方案1】:

    我是新手,遇到了同样的问题。 事实证明,构造函数在 Selenium 4 中已被弃用。 你现在只需要像这样使用它:

    WebDriverWait 等待 = new WebDriverWait(driver, Duration.ofSeconds(10));

    希望对你有帮助!

    【讨论】:

      猜你喜欢
      • 2011-03-01
      • 2021-03-16
      • 1970-01-01
      • 1970-01-01
      • 2016-06-12
      • 2022-01-21
      • 1970-01-01
      • 1970-01-01
      • 2011-10-23
      相关资源
      最近更新 更多