selenium: [🐛 Bug]: Unable to create RemoteWebdriver session after setting the browserVersion in selenium 4.11.0

What happened?

I am trying to create a RemoteWebdriver session on Specific version of Chrome browser by setting the chrome Options in Selenium 4.11.0

To start the node, I am adding this parameter: --selenium-manager true

How can we reproduce the issue?

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setCapability("browserName", "chrome");
String browserVersion = (System.getProperty("browserVersion");
chromeOptions.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
chromeOptions.addArguments("--remote-allow-origins=*");
chromeOptions.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
chromeOptions.setBrowserVersion(browserVersion);

URL url = new URL(System.getProperty("remoteurl"));
				chromeOptions.setCapability(CapabilityType.UNHANDLED_PROMPT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);

driver = new RemoteWebDriver(url, chromeOptions);

Relevant log output

[DEBUG] 2023-08-09 20:52:48.349 - Framework : Entered initalizeDriver Method
[INFO ] 2023-08-09 20:52:48.350 - SeleniumLogs folder is already created
[DEBUG] 2023-08-09 20:52:48.357 - Framework : The execution is triggered on http://100.116.194.65:4444/wd/hub grid
[DEBUG] 2023-08-09 20:52:48.357 - Framework : The execution is triggered on chrome
Aug 09, 2023 8:52:48 PM org.openqa.selenium.remote.tracing.opentelemetry.OpenTelemetryTracer createTracer
INFO: Using OpenTelemetry for tracing
java.lang.NullPointerException: Cannot invoke "org.openqa.selenium.remote.RemoteWebDriver.getCapabilities()" because the return value of driver is null

Operating System

Windows 10

Selenium version

Java 4.11.0

What are the browser(s) and version(s) where you see this issue?

Chrome 115

What are the browser driver(s) and version(s) where you see this issue?

Chromedriver 115

Are you using Selenium Grid?

4.11.0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 25 (16 by maintainers)

Most upvoted comments

Without passing browserVersion, though it will always use the installed version of the browser.

If you use "stable" and the browser on the system is no longer the stable version, Selenium will download the latest stable Chrome for Testing and use that instead of what was pre-installed.