G
G
GROMKONO12021-02-01 11:48:13
Java
GROMKONO1, 2021-02-01 11:48:13

When running Chrome Driver on IntelliJ a maven Win 10 project, it opens and immediately closes. exit code 1?

When running webdriver for chrome on IntelliJ, it opens the browser for a second, then closes with an error. Adding interval waits did not help.

The code is like this:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Main {

    public static void main(String[] args) {


        System.setProperty("webdriver.chrome.driver", "c:\\QA\\Selenium\\chromedriver.exe");

        WebDriver driver = new ChromeDriver();
        
        driver.get ("https://google.com");
        
    }


Here's an assembly:
<dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>LATEST</version>
    </dependency>
</dependencies>

And here is what he writes to me in the console:
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 89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/[email protected]{#294}) on port 29617
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 89
Current browser version is 88.0.4324.104 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
Build info: version: '4.0.0-alpha-7', revision: 'de8579b6d5'
System info: host: 'DESKTOP-62RB6V7', ip: '127.0.0.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.1'
Driver info: driver.version: ChromeDriver
remote stacktrace: Backtrace:
Ordinal0 [0x00FBE7D3+124883]
Ordinal0 [0x00FBE7B1+124849]
GetHandleVerifier [0x01208688+193832]
GetHandleVerifier [0x01223AC5+305509]
GetHandleVerifier [0x0122021B+291003]
GetHandleVerifier [0x0121E0AC+282444]
GetHandleVerifier [0x01244A90+440624]
GetHandleVerifier [0x012447FC+439964]
GetHandleVerifier [0x0124154B+426987]
GetHandleVerifier [0x01224FFD+310941]
GetHandleVerifier [0x01225D8E+314414]
GetHandleVerifier [0x01225D19+314297]
GetHandleVerifier [0x012E31EC+1089676]
GetHandleVerifier [0x012E17C9+1082985]
GetHandleVerifier [0x012E13A3+1081923]
GetHandleVerifier [0x013DD9FD+2115741]
Ordinal0 [0x0110B82E+1488942]
Ordinal0 [0x010A5A7D+1071741]
Ordinal0 [0x010A559B+1070491]
Ordinal0 [0x010A54B1+1070257]
Ordinal0 [0x010DFF53+1310547]
BaseThreadInitThunk [0x76106359+25]
RtlGetAppContainerNamedObjectPath [0x775B8944+228]
RtlGetAppContainerNamedObjectPath [0x775B8914+180]

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$1(ProtocolHandshake.java:126)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:139)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:123)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:501)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:127)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:93)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:163)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:150)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:105)
at Main.main(Main.java:12)

Process finished with exit code 1

Thank you in advance!!!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Karbivnichy, 2021-02-01
@hottabxp

And here is what he writes to me in the console:
So, why didn't you read what is written there? In the same place it is written in English in white, incompatibility of versions:
This version of ChromeDriver only supports Chrome version 89
Current browser version is 88.0.4324.104 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

You have ChromeDriver = 89, and chrome itself is 88.
Solutions 2. Either downgrade the driver or update chrome.

O
Orkhan, 2021-02-01
Hasanly @azerphoenix

If you read the logs you posted, you will see this line:

This version of ChromeDriver only supports Chrome version 89

The chrome driver does not support this version of chrome. Downgrade either driver or browser

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question