Skip to content

Commit 878e186

Browse files
committed
[grid] Fixing driver configuration parsing
This covers the case again when the config is passed through the CLI. Fixes #13531
1 parent 5c214ba commit 878e186

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

java/src/org/openqa/selenium/grid/node/config/NodeFlags.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ public class NodeFlags implements HasRoles {
151151
+ "file to improve readability. Command line example: "
152152
+ "--driver-configuration display-name=\"Firefox Nightly\" max-sessions=2 "
153153
+ "webdriver-path=\"/usr/local/bin/geckodriver\" "
154-
+ "stereotype='{\"browserName\": \"firefox\", \"browserVersion\": \"86\", "
155-
+ "\"moz:firefoxOptions\": "
156-
+ "{\"binary\":\"/Applications/Firefox Nightly.app/Contents/MacOS/firefox\"}}'",
154+
+ "stereotype=\"{\\\"browserName\\\": \\\"firefox\\\", "
155+
+ "\\\"browserVersion\\\": \\\"86\\\", "
156+
+ "\\\"moz:firefoxOptions\\\": "
157+
+ "{\\\"binary\":\"/Applications/Firefox Nightly.app/Contents/MacOS/firefox\\\"}}\"",
157158
arity = 4,
158159
variableArity = true,
159160
splitter = NonSplittingSplitter.class)

java/src/org/openqa/selenium/grid/node/config/NodeOptions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ private void addDriverConfigs(
370370
.ifPresent(
371371
drivers -> {
372372
List<Map<String, String>> configList = new ArrayList<>();
373+
if (drivers.isEmpty()) {
374+
// This is the case when the configuration is provided through the CLI.
375+
config.getAll(NODE_SECTION, "driver-configuration").ifPresent(drivers::add);
376+
}
373377

374378
// iterate over driver configurations
375379
for (List<String> driver : drivers) {

0 commit comments

Comments
 (0)