简体   繁体   English

Java - Selenium - 无法找到与 CDP 版本 94 完全匹配的版本,因此返回找到的最接近的版本:93

[英]Java - Selenium - Unable to find an exact match for CDP version 94, so returning the closest version found: 93

I'm new to Selenium and I'm having an error about CDP versions when running my code.我是 Selenium 的新手,在运行我的代码时遇到有关 CDP 版本的错误。 This is my code.这是我的代码。 It's simple, aiming to log in into some web page.很简单,旨在登录某个web页面。 The driver opens, fills the email and password but when reaching the button, the driver closes.驱动程序打开,填写 email 和密码,但当到达按钮时,驱动程序关闭。 Even if I set another wait for ten minutes after the button.即使我设置了另一个按钮后等待十分钟。

    public static void main(String[] args) {
            System.setProperty("webdriver.chrome.driver","path/to/my/chromedriver");
            WebDriver driver = new ChromeDriver();
            WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
            try {
                driver.get("https://someweb.com/");
                driver.findElement(By.name("Email")).sendKeys("anemail@email.com");
                driver.findElement(By.name("Password")).sendKeys("randomPass");
                driver.findElement(By.xpath("//*[@id=\"login-form\"]/button")).sendKeys(Keys.ENTER);
            } finally {
                driver.quit();
            }

        }

I get the following warning in my log我在日志中收到以下警告

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 94.0.4606.61 (418b78f5838ed0b1c69bb4e51ea0252171854915-refs/branch-heads/4606@{#1204}) on port 44814
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
oct 06, 2021 9:45:02 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
oct 06, 2021 9:45:02 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 94, so returning the closest version found: 93
oct 06, 2021 9:45:02 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Found CDP implementation for version 94 of 93

Process finished with exit code 0

And I have the following dependencies in my pom我的 pom 中有以下依赖项

    <dependencies>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.0.0-rc-1</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
            <version>4.0.0-rc-1</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-devtools</artifactId>
            <version>4.0.0-rc-1</version>
        </dependency>
    </dependencies>

I have no idea why the driver exits so suddenly.我不知道司机为什么突然下车。 Chrome and ChromeDriver version is 94.0.4606.61. Chrome 和 ChromeDriver 版本为 94.0.4606.61。 Thanks in advance!提前致谢!

As per Selenium documentation,根据Selenium文档,

  • The version v4.0.0-rc-1 supports CDP versions: 85 , 92 , 93 .版本v4.0.0-rc-1支持CDP版本: 859293

But you are using 94 version of Chrome and ChromeDriver .但是你使用的是94版本的ChromeChromeDriver So please update your dependencies to latest version v4.0.0-rc-2所以请将您的依赖项更新到最新版本v4.0.0-rc-2

Dependency :依赖性

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.0.0-rc-2</version>
</dependency>

Reference : https://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOG参考https://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOG

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java-Selenium- 无法找到 CDP 版本 98 的完全匹配,因此返回找到的最接近的版本:97 - Java-Selenium- Unable to find an exact match for CDP version 98, so returning the closest version found: 97 Selenium 连接重置:无法找到 CDP 版本 96 的完全匹配,因此返回找到的最接近的版本:95 - Selenium Connection Reset: Unable to find an exact match for CDP version 96, so returning the closest version found: 95 Selenium Chromedriver:无法找到与 CDP 版本 98 完全匹配的版本,因此返回找到的最接近的版本:97 - Selenium Chromedriver: Unable to find an exact match for CDP version 98, so returning the closest version found: 97 CdpVersionFinder findNearestMatch 警告:无法找到 CDP 版本 100 的精确匹配项,因此返回找到的最接近的版本:99 和 Selenium - CdpVersionFinder findNearestMatch WARNING: Unable to find an exact match for CDP version 100, so returning the closest version found: 99 with Selenium 警告:无法找到与 CDP 版本 107 完全匹配的版本,因此返回找到的最接近的版本:106 - WARNING: Unable to find an exact match for CDP version 107, so returning the closest version found: 106 无法找到 CDP 的完全匹配 - 无法从 windows 弹出窗口上传 SELENIUM 和 JAVA 中的文件 - Unable to find an exact match for CDP - Cannot upload a file in SELENIUM & JAVA from windows popup Selenium 4.0.x 在 IDE 中有效,但在胖 JAR 文件中无效 - 找不到适用于我的浏览器版本的 CDP 实现 - Selenium 4.0.x works in IDE but not in fat JAR file - a CDP implementation for my browser version cannot be found Selenium 错误:ChromeDriver 仅支持 Chrome 版本 94 - Selenium Error: ChromeDriver only supports Chrome version 94 无法找到捆绑的 Java 版本,我在开发中遇到错误,所以我无法前进 - Unable to find bundled Java version, I get errors in my development so i cant move forward 在Mongodb中找不到Java中确切日期匹配的文档 - Unable to find a document in Mongodb where exact date match in java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM