You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Up to and including Selenium 4.10.0 it was possible to create a ChromeDriverService where the Selenium Manager automatically downloads the ChromeDriver (Chrome is already installed).
Since Selenium 4.11.0 this code fails showing the following stacktrace:
Exception in thread "main" java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at org.openqa.selenium.os.ExecutableFinder.find(ExecutableFinder.java:47)
at org.openqa.selenium.os.OsProcess.<init>(OsProcess.java:63)
at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:35)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:198)
at org.example.Main.main(Main.java:24))
Looking at the ChromeDriverService documentation i tried using ChromeDriverService.createDefaultService().
Exception in thread "main" java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at org.openqa.selenium.os.ExecutableFinder.find(ExecutableFinder.java:47)
at org.openqa.selenium.os.OsProcess.<init>(OsProcess.java:63)
at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:35)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:198)
at org.example.Main.main(Main.java:24)
The documentation of ChromeDriverService.createDefaultService() states that
In this configuration, the service will use the ChromeDriver executable identified by DriverFinder.getPath(DriverService, Capabilities).
But looking into the ChromeDriverServices and DriverServices builder code i could not find any usage of DriverFinder.getPath().
From my point of view, contrary to the documentation, the use of DriverFinder.getPath() is missing when using the ChromeDriverService.Builder with default values.
How can we reproduce the issue?
public class Main {
public static void main(String[] args) throws IOException {
// Use either Builder() or createDefaultService()
// DriverService driverService = new ChromeDriverService.Builder().usingAnyFreePort().build();
DriverService driverService = ChromeDriverService.createDefaultService();
driverService.start(); // will fail using Selenium 4.11.0 and later
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(driverService.getUrl(), new ChromeOptions());
remoteWebDriver.navigate().to("https://www.selenium.dev");
}
}
Relevant log output
Sept. 04, 2023 3:53:29 PM org.openqa.selenium.remote.service.DriverService start
FINE: Starting driver at null with [--port=44284]
Exception in thread "main" java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at org.openqa.selenium.os.ExecutableFinder.find(ExecutableFinder.java:47)
at org.openqa.selenium.os.OsProcess.<init>(OsProcess.java:63)
at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:35)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:198)
at org.example.Main.main(Main.java:33)
Operating System
Windows 10
Selenium version
4.12.0 [Java]
What are the browser(s) and version(s) where you see this issue?
Chrome 116.0.5845.141
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 116.0.5845.96
Are you using Selenium Grid?
No Selenium Grid involved
The text was updated successfully, but these errors were encountered:
The documented way to use the service is to pass it in as an argument to a local driver constructor.
For selenium manager to work, it needs to know both the options and service information. Since you can create options instance after service instance we don't force the executable in the service builder any more.
You can pass in the location of the driver in the service class, or you can use the chromedriver constructor to start the service.
What happened?
Up to and including Selenium 4.10.0 it was possible to create a ChromeDriverService where the Selenium Manager automatically downloads the ChromeDriver (Chrome is already installed).
Since Selenium 4.11.0 this code fails showing the following stacktrace:
Looking at the ChromeDriverService documentation i tried using
ChromeDriverService.createDefaultService()
.This yields the same result:
The documentation of
ChromeDriverService.createDefaultService()
states thatBut looking into the ChromeDriverServices and DriverServices builder code i could not find any usage of
DriverFinder.getPath()
.The only working solution i came up with is
From my point of view, contrary to the documentation, the use of
DriverFinder.getPath()
is missing when using the ChromeDriverService.Builder with default values.How can we reproduce the issue?
Relevant log output
Operating System
Windows 10
Selenium version
4.12.0 [Java]
What are the browser(s) and version(s) where you see this issue?
Chrome 116.0.5845.141
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 116.0.5845.96
Are you using Selenium Grid?
No Selenium Grid involved
The text was updated successfully, but these errors were encountered: