Skip to content

Commit e1e538e

Browse files
committed
[java] Add check back to driver service session factory
1 parent a040c34 commit e1e538e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ public Either<WebDriverException, ActiveSession> apply(CreateSessionRequest sess
131131
attributeMap.put(AttributeKey.LOGGER_CLASS.getKey(), this.getClass().getName());
132132

133133
DriverService service = builder.build();
134-
Result driverResult = DriverFinder.getPath(service, capabilities);
135-
service.setExecutable(driverResult.getDriverPath());
136-
if (driverResult.getBrowserPath() != null && !driverResult.getBrowserPath().isEmpty()) {
137-
capabilities = setBrowserBinary(capabilities, driverResult.getBrowserPath());
134+
if (service.getExecutable() == null) {
135+
Result driverResult = DriverFinder.getPath(service, capabilities);
136+
service.setExecutable(driverResult.getDriverPath());
137+
if (driverResult.getBrowserPath() != null && !driverResult.getBrowserPath().isEmpty()) {
138+
capabilities = setBrowserBinary(capabilities, driverResult.getBrowserPath());
139+
}
138140
}
139141

140142
Optional<Platform> platformName = Optional.ofNullable(capabilities.getPlatformName());

0 commit comments

Comments
 (0)