【问题标题】:Unable to find an exact match for CDP version 109, so returning the closest version found: a no-op implementation using Selenium 4x ChromeDriver 109无法找到与 CDP 版本 109 完全匹配的版本,因此返回找到的最接近的版本:使用 Selenium 4x ChromeDriver 109 的无操作实现
【发布时间】:2023-02-02 05:41:06
【问题描述】:

我正在尝试执行一个基本的 Selenium Java 程序:

public static void main(String[] args)
{
    System.setProperty("webdriver.chrome.driver", "C:\\BrowserDrivers\\chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    driver.quit();
}

使用以下配置:

  • 硒 4.x
  • 版本 109.0.5414.75(正式版)(64 位)(赢 10)
  • ChromeDriver 109.0.5414.25

铬驱动程序:

Chrome 和 ChromeDriver 都是版本 109.x,虽然程序成功执行,但我仍然看到一些警告控制台消息如下:

Starting ChromeDriver 109.0.5414.25 (771113d280dd3dda2fb422a6c805f0eb2b8ee6ed-refs/branch-heads/5414@{#303}) on port 57273
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Jan 14, 2023 3:10:47 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected upstream dialect: W3C
Jan 14, 2023 3:10:47 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 109, so returning the closest version found: a no-op implementation
Jan 14, 2023 3:10:47 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Unable to find CDP implementation matching 109.
Jan 14, 2023 3:10:47 AM org.openqa.selenium.chromium.ChromiumDriver lambda$new$3
WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.3.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.

有人可以帮助我理解警告背后的问题:

WARNING: Unable to find an exact match for CDP version 109, so returning the closest version found: a no-op implementation

WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.3.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.

【问题讨论】:

    标签: selenium google-chrome selenium-webdriver selenium-chromedriver selenium4


    【解决方案1】:

    这是因为 ' 的兼容版本Selenium 开发工具' 尚未发布。最新的 'Selenium 开发工具' 版本为 v108,与 Chrome 版本兼容V108.

    您可以参考以下存储库以获取所有Selenium 开发工具版本:

    https://repo1.maven.org/maven2/org/seleniumhq/selenium/

    我检查了硒 v4.7.2Chrome 版本 109.0.5414.75并与Chrome 驱动程序 v109.0.5414.74,得到以下相同的警告:

    然后我将 Chrome 浏览器降级为v108.0.5359.126, 检查过硒 v4.7.2Chrome 驱动程序 v108.0.5359.71,这次没有得到警告:

    下一个Selenium 开发工具版本可能会在下一次 Selenium 升级时发布。

    您还可以从 Maven 存储库单独安装 Selenium Devtools:https://mvnrepository.com/search?q=Selenium+DevTools+V108

    无论如何,这只是一个警告。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-26
      • 2022-07-21
      • 2021-12-30
      • 2022-11-02
      • 1970-01-01
      • 2021-03-06
      • 2021-01-23
      • 2022-07-08
      相关资源
      最近更新 更多