java 什么是SessionNotCreatedException:无法启动新会话,可能的原因是远程服务器地址无效的错误手段?

sqyvllje  于 2023-06-28  发布在  Java
关注(0)|答案(1)|浏览(193)

我在Selenium Java中遇到了一个错误。我不明白这是什么意思这个错误在Selenium Java中意味着什么?

יונ 26, 2023 11:22:49 AM org.openqa.selenium.remote.service.DriverService$Builder getLogOutput
INFO: Driver logs no longer sent to console by default; https://www.selenium.dev/documentation/webdriver/drivers/service/#setting-log-output
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
Host info: host: 'DESKTOP-LDB7RDR', ip: '192.168.181.1'
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_212'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*], extensions: []}}]}]
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:549)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:227)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
    at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:107)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:87)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:82)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:50)
    at selenium.Selenium.main(Selenium.java:40)
Caused by: java.lang.IllegalStateException: Actual executable Unable to find executable for: C:\selenium\chrome
    at org.openqa.selenium.internal.Require$StateChecker.nonNull(Require.java:314)
    at org.openqa.selenium.os.OsProcess.<init>(OsProcess.java:65)
    at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:35)
    at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:210)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:119)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:531)
    ... 7 more
C:\Users\שם לא ידוע\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 1 second)
5n0oy7gb

5n0oy7gb1#

此错误消息...

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

...表示Selenium驱动ChromeDriver发起的google-chrome _browsing上下文打开失败。

根本原因

考虑到Selenium版本为**4.10.0***,java.version**1.8.0_212*太 * 旧 * 和 * 古老 *。

解决方案

确保:

相关问题