Skip to content

Commit

Permalink
[java] use Selenium Manager to locate drivers on PATH (#12352)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
titusfortner and diemol authored Jul 21, 2023
1 parent 12bc023 commit ee32f22
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions java/src/org/openqa/selenium/remote/service/DriverFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,14 @@
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.internal.Require;
import org.openqa.selenium.manager.SeleniumManager;
import org.openqa.selenium.os.ExecutableFinder;
import org.openqa.selenium.remote.NoSuchDriverException;

public class DriverFinder {

private static final Logger LOG = Logger.getLogger(DriverFinder.class.getName());

public static String getPath(DriverService service, Capabilities options) {
Require.nonNull("Browser options", options);
String exePath = System.getProperty(service.getDriverProperty());

if (exePath == null) {
exePath = new ExecutableFinder().find(service.getDriverName());
}

if (service.getDriverExecutable() != null) {
// This is needed for Safari Technology Preview until Selenium Manager manages locating on
// PATH
exePath = service.getDriverExecutable().getAbsolutePath();
}

if (exePath == null) {
try {
exePath = SeleniumManager.getInstance().getDriverPath(options);
Expand Down

0 comments on commit ee32f22

Please sign in to comment.