Skip to content

Commit

Permalink
[java] do not set browser binary if it is an empty string (#12738)
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 16, 2023
1 parent 9ff1fe2 commit 8ed8aa2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/chrome/ChromeDriver.java
Expand Up @@ -99,7 +99,7 @@ private static ChromeDriverCommandExecutor generateExecutor(
if (service.getExecutable() == null) {
Result result = DriverFinder.getPath(service, options);
service.setExecutable(result.getDriverPath());
if (result.getBrowserPath() != null) {
if (result.getBrowserPath() != null && !result.getBrowserPath().isEmpty()) {
options.setBinary(result.getBrowserPath());
}
}
Expand Down
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/edge/EdgeDriver.java
Expand Up @@ -71,7 +71,7 @@ private static EdgeDriverCommandExecutor generateExecutor(
if (service.getExecutable() == null) {
Result result = DriverFinder.getPath(service, options);
service.setExecutable(result.getDriverPath());
if (result.getBrowserPath() != null) {
if (result.getBrowserPath() != null && !result.getBrowserPath().isEmpty()) {
options.setBinary(result.getBrowserPath());
}
}
Expand Down
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/firefox/FirefoxDriver.java
Expand Up @@ -141,7 +141,7 @@ private static FirefoxDriverCommandExecutor generateExecutor(
if (service.getExecutable() == null) {
Result result = DriverFinder.getPath(service, options);
service.setExecutable(result.getDriverPath());
if (result.getBrowserPath() != null) {
if (result.getBrowserPath() != null && !result.getBrowserPath().isEmpty()) {
options.setBinary(result.getBrowserPath());
}
}
Expand Down
Expand Up @@ -134,7 +134,7 @@ public Either<WebDriverException, ActiveSession> apply(CreateSessionRequest sess
if (service.getExecutable() == null) {
Result result = DriverFinder.getPath(service, capabilities);
service.setExecutable(result.getDriverPath());
if (result.getBrowserPath() != null) {
if (result.getBrowserPath() != null && !result.getBrowserPath().isEmpty()) {
capabilities = setBrowserBinary(capabilities, result.getBrowserPath());
}
}
Expand Down

0 comments on commit 8ed8aa2

Please sign in to comment.