Skip to content

Commit 7bd06fc

Browse files
titusfortneraguspe
authored andcommitted
[java] do not set browser binary if it is an empty string (SeleniumHQ#12738)
1 parent 4ab81e3 commit 7bd06fc

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

java/src/org/openqa/selenium/chrome/ChromeDriver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private static ChromeDriverCommandExecutor generateExecutor(
9999
if (service.getExecutable() == null) {
100100
Result result = DriverFinder.getPath(service, options);
101101
service.setExecutable(result.getDriverPath());
102-
if (result.getBrowserPath() != null) {
102+
if (result.getBrowserPath() != null && !result.getBrowserPath().isEmpty()) {
103103
options.setBinary(result.getBrowserPath());
104104
}
105105
}

java/src/org/openqa/selenium/edge/EdgeDriver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private static EdgeDriverCommandExecutor generateExecutor(
7171
if (service.getExecutable() == null) {
7272
Result result = DriverFinder.getPath(service, options);
7373
service.setExecutable(result.getDriverPath());
74-
if (result.getBrowserPath() != null) {
74+
if (result.getBrowserPath() != null && !result.getBrowserPath().isEmpty()) {
7575
options.setBinary(result.getBrowserPath());
7676
}
7777
}

java/src/org/openqa/selenium/firefox/FirefoxDriver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private static FirefoxDriverCommandExecutor generateExecutor(
141141
if (service.getExecutable() == null) {
142142
Result result = DriverFinder.getPath(service, options);
143143
service.setExecutable(result.getDriverPath());
144-
if (result.getBrowserPath() != null) {
144+
if (result.getBrowserPath() != null && !result.getBrowserPath().isEmpty()) {
145145
options.setBinary(result.getBrowserPath());
146146
}
147147
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public Either<WebDriverException, ActiveSession> apply(CreateSessionRequest sess
134134
if (service.getExecutable() == null) {
135135
Result result = DriverFinder.getPath(service, capabilities);
136136
service.setExecutable(result.getDriverPath());
137-
if (result.getBrowserPath() != null) {
137+
if (result.getBrowserPath() != null && !result.getBrowserPath().isEmpty()) {
138138
capabilities = setBrowserBinary(capabilities, result.getBrowserPath());
139139
}
140140
}

0 commit comments

Comments
 (0)