admin管理员组

文章数量:1402795

I am trying to run a simple Selenide test using Selenium 4.14.1, but I keep getting this error when launching Chrome:

Exception in thread "main" .openqa.selenium.SessionNotCreatedException: Could not start a new session. 
Possible causes are invalid address of the remote server or browser start-up failure.
Caused by: java.lang.NoSuchMethodError: 'void com.googlemon.base.Throwables.throwIfUnchecked(java.lang.Throwable)'
Setup Details:
OS: Windows 11

Java: 17.0.10

Selenium: 4.14.1

Selenide: 7.6.0

ChromeDriver: Managed via WebDriverManager

<!-- Explicitly include Guava -->
<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>32.0.0-jre</version>
</dependency>

<!-- WebDriverManager -->
<dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>5.9.2</version>
</dependency>

<!-- Selenide -->
<dependency>
    <groupId>com.codeborne</groupId>
    <artifactId>selenide</artifactId>
    <version>7.6.0</version>
</dependency>

<!-- Selenium -->
<dependency>
    <groupId>.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
</dependency>

<dependency>
    <groupId>.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>3.0.12</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Troubleshooting Steps Tried: Checked for conflicting dependencies using mvn dependency:tree | grep guava

Explicitly added Guava 32.0.0-jre (latest at the time)

Verified WebDriver setup (WebDriverManager automatically downloads the correct ChromeDriver version)

Tried running with a clean Maven build using mvn clean install

Tried excluding Guava from transitive dependencies

Despite these fixes, the error still occurs.

Question:

  • Could this be due to an indirect dependency conflict (e.g., groovy-all)?

  • Should I explicitly exclude older Guava versions from groovy-all or another library?

  • Is this related to Selenide 7.6.0 and Selenium 4.14.1 compatibility?

Any help would be greatly appreciated!

本文标签: javaSelenideSelenium NoSuchMethodError in ThrowablesthrowIfUnchecked() when launching ChromeStack Overflow