2

A window appears after launch and immediately disappears, I can not understand what's wrong. Google except for the latest version, selenium is also set to the LATEST parameter (nothing changes with a specific version).

Error:

org.openqa.selenium.SessionNotCreatedException: Message:  Could not start a new session. Response code 500. Message: session not created

Code:

code

Error: Error

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Dmitriy N
  • 17
  • 1
  • 1
  • 2

7 Answers7

1

Update your chromedriver version, it seems your your browser and browser current driver version aren't same.

https://chromedriver.storage.googleapis.com/index.html?
Akzy
  • 1,817
  • 1
  • 7
  • 19
  • I downloaded the latest version namely 100.0.4896.20, need some other one? – Dmitriy N Mar 22 '22 at 16:53
  • I installed it before the last one and now it loads the site, but everything automatically closes automatically now exitcode 0 instead of 1 – Dmitriy N Mar 22 '22 at 17:04
  • ChromeDriver was started successfully. мар 22, 2022 7:09:35 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C мар 22, 2022 7:09:35 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch WARNING: Unable to find an exact match for CDP version 99, so returning the closest version found: 97 мар 22, 2022 7:09:35 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch INFO: Found CDP implementation for version 99 of 97 Process finished with exit code 0 – Dmitriy N Mar 22 '22 at 17:10
  • download 97 again does not work immediately as it was in the beginning – Dmitriy N Mar 22 '22 at 17:14
1

This error message...

org.openqa.selenium.SessionNotCreatedException: Message:  Could not start a new session. Response code 500. Message: session not created:
.
Driver info: org.openqa.selenium.chrome.ChromeDriver

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chrome=99.0
  • Release Notes of ChromeDriver v99.0 clearly mentions the following :

Supports Chrome version 99

  • But your chromedriver version is not getting detected.

Driver info: org.openqa.selenium.chrome.ChromeDriver

  • Your JDK version 1.8.0_281 is also old and ancient.

So most possibly there is a mismatch between jdk version, chromedriver version and the chrome=99.0


Solution

Ensure that:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
0

If some one is on linux,

some distros install /usr/bin/google-chrome-stable, web driver manager tries to retry the version of chrome with the command

/usr/bin/google-chrome --version

Since that bin does not exists, is going to fail; The solution is very simple just a simbolic link to google-chrome

# ln -s /usr/bin/google-chrome-stable /usr/bin/google-chrome
osdamv
  • 3,493
  • 2
  • 21
  • 33
0

More than an answer this continues with the question.

I'm using serenity-bdd with the following characteristics:

  • Ubuntu: 22.04.1
  • Google-Chrome: 106.0.5249.103
  • Chrome driver: 106.0.5249.61

And the generated message error is:

<<< ERROR!
net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate class org.openqa.selenium.chrome.ChromeDriver
Caused by: net.thucydides.core.webdriver.DriverConfigurationError: 
Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: exited abnormally.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Was trying with different driver combinations and none of them are working. Funny enough when i run on windows with the same configuration all works.

JRod
  • 151
  • 1
  • 5
  • After long looking finally it is working, the solution was to define correctly the switches for chrome into the serenity.conf as follows: chrome { switches = """--start-maximized;--test-type;--no-sandbox;--ignore-certificate-errors;--disable-popup-blocking;--disable-default-apps;--disable-extensions-file-access-check;--incognito;--disable-infobars,--disable-gpu""" capabilities.acceptInsecureCerts = true } Before the program couldn't identify the way to run it and that's why it was producing the error. – JRod Dec 06 '22 at 13:34
0

Starting ChromeDriver 109.0.5414.74 (e7c5703604daa9cc128ccf5a5d3e993513758913-refs/branch-heads/5414@{#1172}) on port 48484 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: Could not start a new session. Response code 500. Message: unknown error: Failed to create Chrome process. Host info: host: 'A-LAPTOP', ip: '192..0.' Build info: version: '4.7.2', revision: '4d4020c3b7' System info: os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.5' Driver info: org.openqa.selenium.chrome.ChromeDriver Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}] at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:148) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:106) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156) at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:535) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:228) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:156) at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:101) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:82) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:50) at com.project.skyfall.Browser_Drivers.main(Browser_Drivers.java:13)

  • I am stuck, kindly give the details. – Aditya Rana Jan 27 '23 at 17:56
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 30 '23 at 01:39
  • I have the exact same error. Out of the blue – GGEv Mar 23 '23 at 21:10
0
I resolved this issue by simply removing the old_chrome program stored in the Temp folder
C:\Users\<Your User>\AppData\Local\Google\Chrome\Temp\scoped_dir
Herker
  • 552
  • 6
  • 20
-2

In short, you need to install the previous version of the web driver with such a problem

Dmitriy N
  • 17
  • 1
  • 1
  • 2