Skip to content

Commit

Permalink
[grid] Fixing driver configuration parsing
Browse files Browse the repository at this point in the history
This covers the case again when the config
is passed through the CLI.

Fixes #13531
  • Loading branch information
diemol committed Feb 5, 2024
1 parent 5c214ba commit 878e186
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions java/src/org/openqa/selenium/grid/node/config/NodeFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ public class NodeFlags implements HasRoles {
+ "file to improve readability. Command line example: "
+ "--driver-configuration display-name=\"Firefox Nightly\" max-sessions=2 "
+ "webdriver-path=\"/usr/local/bin/geckodriver\" "
+ "stereotype='{\"browserName\": \"firefox\", \"browserVersion\": \"86\", "
+ "\"moz:firefoxOptions\": "
+ "{\"binary\":\"/Applications/Firefox Nightly.app/Contents/MacOS/firefox\"}}'",
+ "stereotype=\"{\\\"browserName\\\": \\\"firefox\\\", "
+ "\\\"browserVersion\\\": \\\"86\\\", "
+ "\\\"moz:firefoxOptions\\\": "
+ "{\\\"binary\":\"/Applications/Firefox Nightly.app/Contents/MacOS/firefox\\\"}}\"",
arity = 4,
variableArity = true,
splitter = NonSplittingSplitter.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ private void addDriverConfigs(
.ifPresent(
drivers -> {
List<Map<String, String>> configList = new ArrayList<>();
if (drivers.isEmpty()) {
// This is the case when the configuration is provided through the CLI.
config.getAll(NODE_SECTION, "driver-configuration").ifPresent(drivers::add);
}

// iterate over driver configurations
for (List<String> driver : drivers) {
Expand Down

0 comments on commit 878e186

Please sign in to comment.