2323import org .openqa .selenium .WebDriverException ;
2424import org .openqa .selenium .chromium .ChromiumDriverLogLevel ;
2525import org .openqa .selenium .remote .service .DriverService ;
26+ import org .openqa .selenium .remote .service .DriverServiceInfo ;
2627
2728import java .io .File ;
2829import java .io .IOException ;
4142 */
4243public class ChromeDriverService extends DriverService {
4344
45+ public static final String CHROME_DRIVER_NAME = "chromedriver" ;
46+
4447 /**
4548 * System property that defines the location of the ChromeDriver executable that will be used by
4649 * the {@link #createDefaultService() default service}.
@@ -135,11 +138,19 @@ public ChromeDriverService(
135138 unmodifiableMap (new HashMap <>(environment )));
136139 }
137140
141+ public String getDriverName () {
142+ return CHROME_DRIVER_NAME ;
143+ }
144+
145+ public String getDriverProperty () {
146+ return CHROME_DRIVER_EXE_PROPERTY ;
147+ }
148+
138149 /**
139150 * Configures and returns a new {@link ChromeDriverService} using the default configuration. In
140- * this configuration, the service will use the ChromeDriver executable identified by the
141- * {@link #CHROME_DRIVER_EXE_PROPERTY} system property. Each service created by this method will
142- * be configured to use a free port on the current system.
151+ * this configuration, the service will use the ChromeDriver executable identified by
152+ * {@link org.openqa.selenium.remote. service.DriverFinder#getPath(DriverServiceInfo, Capabilities)}.
153+ * Each service created by this method will be configured to use a free port on the current system.
143154 *
144155 * @return A new ChromeDriverService using the default configuration.
145156 */
@@ -149,9 +160,9 @@ public static ChromeDriverService createDefaultService() {
149160
150161 /**
151162 * Configures and returns a new {@link ChromeDriverService} using the supplied configuration. In
152- * this configuration, the service will use the ChromeDriver executable identified by the
153- * {@link #CHROME_DRIVER_EXE_PROPERTY} system property. Each service created by this method will
154- * be configured to use a free port on the current system.
163+ * this configuration, the service will use the ChromeDriver executable identified by
164+ * {@link org.openqa.selenium.remote. service.DriverFinder#getPath(DriverServiceInfo, Capabilities)}.
165+ * Each service created by this method will be configured to use a free port on the current system.
155166 *
156167 * @return A new ChromeDriverService using the supplied configuration from {@link ChromeOptions}.
157168 * @deprecated Use {@link Builder#withLogLevel(ChromiumDriverLogLevel)} }
@@ -173,7 +184,7 @@ public static ChromeDriverService createServiceWithConfig(ChromeOptions options)
173184 * @return Whether the browser driver path was found.
174185 */
175186 static boolean isPresent () {
176- return findExePath ("chromedriver" , CHROME_DRIVER_EXE_PROPERTY ) != null ;
187+ return findExePath (CHROME_DRIVER_NAME , CHROME_DRIVER_EXE_PROPERTY ) != null ;
177188 }
178189
179190 /**
@@ -323,14 +334,6 @@ public Builder withReadableTimestamp(Boolean readableTimestamp) {
323334 return this ;
324335 }
325336
326- @ Override
327- protected File findDefaultExecutable () {
328- return findExecutable (
329- "chromedriver" , CHROME_DRIVER_EXE_PROPERTY ,
330- "https://chromedriver.chromium.org/" ,
331- "https://chromedriver.chromium.org/downloads" );
332- }
333-
334337 @ Override
335338 protected List <String > createArgs () {
336339 if (getLogFile () == null ) {
0 commit comments