Skip to content

Commit

Permalink
[java] Making sure browser path is not null
Browse files Browse the repository at this point in the history
Closes #12450
  • Loading branch information
diemol committed Jul 31, 2023
1 parent e69feee commit aa68cb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion java/src/org/openqa/selenium/chrome/ChromeDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ private static ChromeDriverCommandExecutor generateExecutor(
if (service.getExecutable() == null) {
Result result = DriverFinder.getPath(service, options);
service.setExecutable(result.getDriverPath());
options.setBinary(result.getBrowserPath());
if (result.getBrowserPath() != null) {
options.setBinary(result.getBrowserPath());
}
}
return new ChromeDriverCommandExecutor(service, clientConfig);
}
Expand Down
4 changes: 3 additions & 1 deletion java/src/org/openqa/selenium/edge/EdgeDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ private static EdgeDriverCommandExecutor generateExecutor(
if (service.getExecutable() == null) {
Result result = DriverFinder.getPath(service, options);
service.setExecutable(result.getDriverPath());
options.setBinary(result.getBrowserPath());
if (result.getBrowserPath() != null) {
options.setBinary(result.getBrowserPath());
}
}
return new EdgeDriverCommandExecutor(service, clientConfig);
}
Expand Down
4 changes: 3 additions & 1 deletion java/src/org/openqa/selenium/firefox/FirefoxDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ private static FirefoxDriverCommandExecutor generateExecutor(
if (service.getExecutable() == null) {
Result result = DriverFinder.getPath(service, options);
service.setExecutable(result.getDriverPath());
options.setBinary(result.getBrowserPath());
if (result.getBrowserPath() != null) {
options.setBinary(result.getBrowserPath());
}
}
return new FirefoxDriverCommandExecutor(service, clientConfig);
}
Expand Down

0 comments on commit aa68cb1

Please sign in to comment.