Skip to content

[🐛 Bug]: ChromiumOptions: ClassCastException when "args" not provided #12064

@kool79

Description

@kool79

What happened?

https://github.com/SeleniumHQ/selenium/blob/43eb1e5477c9ef30bf6e2097ef984dec3f25077f/java/src/org/openqa/selenium/chromium/ChromiumOptions.java#LL369C9-L369C97

List<String> arguments = (List<String>) (options.getOrDefault("args", new HashMap<>()));
should be fixed to 
List<String> arguments = (List<String>) (options.getOrDefault("args", new ArrayList<>()));

you try to cast HashMap to List.

How can we reproduce the issue?

.

Relevant log output

java.lang.ClassCastException: class java.util.HashMap cannot be cast to class java.util.List (java.util.HashMap and java.util.List are in module java.base of loader 'bootstrap')
	at org.openqa.selenium.chromium.ChromiumOptions.mergeInOptionsFromCaps(ChromiumOptions.java:346)
	at org.openqa.selenium.chrome.ChromeOptions.merge(ChromeOptions.java:78)

Operating System

windows

Selenium version

4.8.0, 4.9.0

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

chrome

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

.

Are you using Selenium Grid?

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions