Skip to content

Commit 74e0af8

Browse files
committed
[Java] Using driver path always for Safari and Safari Technology Preview
Fixes #11952
1 parent 59fa77c commit 74e0af8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public static String getPath(DriverService service, Capabilities options) {
1717
String defaultPath = new ExecutableFinder().find(service.getDriverName());
1818
String exePath = System.getProperty(service.getDriverProperty(), defaultPath);
1919

20-
if (exePath == null && service.getDriverExecutable() != null) {
20+
if (service.getDriverExecutable() != null) {
21+
// This is the case for Safari and Safari Technology Preview
2122
exePath = service.getDriverExecutable().getAbsolutePath();
2223
}
2324

@@ -35,10 +36,9 @@ public static String getPath(DriverService service, Capabilities options) {
3536
"see https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/",
3637
service.getDriverName());
3738

38-
File exe = new File(validPath);
39-
Require.state("The driver executable", exe).isFile();
40-
Require.stateCondition(exe.canExecute(), "It must be an executable file: %s", exe);
41-
return validPath;
42-
}
43-
39+
File exe = new File(validPath);
40+
Require.state("The driver executable", exe).isFile();
41+
Require.stateCondition(exe.canExecute(), "It must be an executable file: %s", exe);
42+
return validPath;
43+
}
4444
}

0 commit comments

Comments
 (0)