Skip to content

Commit 5bce8d9

Browse files
committed
[Java] Fixes #12682
1 parent 8a1f5da commit 5bce8d9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

java/src/org/openqa/selenium/remote/service/DriverService.java

+6
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ public void start() throws IOException {
194194
if (process != null) {
195195
return;
196196
}
197+
if (this.executable == null) {
198+
if (getDefaultDriverOptions().getBrowserName().isEmpty()) {
199+
throw new WebDriverException("Driver executable is null and browser name is not set.");
200+
}
201+
this.executable = DriverFinder.getPath(this, getDefaultDriverOptions()).getDriverPath();
202+
}
197203
LOG.fine(String.format("Starting driver at %s with %s", this.executable, this.args));
198204
process = new CommandLine(this.executable, args.toArray(new String[] {}));
199205
process.setEnvironmentVariables(environment);

java/src/org/openqa/selenium/safari/SafariTechPreviewDriverService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public File getDriverExecutable() {
105105
}
106106

107107
@Override
108-
protected Capabilities getDefaultDriverOptions() {
108+
public Capabilities getDefaultDriverOptions() {
109109
return new SafariOptions().setUseTechnologyPreview(true);
110110
}
111111

0 commit comments

Comments
 (0)