2121
2222import org .openqa .selenium .Capabilities ;
2323import org .openqa .selenium .WebDriverException ;
24+ import org .openqa .selenium .remote .service .DriverServiceInfo ;
2425import org .openqa .selenium .chromium .ChromiumDriverLogLevel ;
2526import org .openqa .selenium .remote .service .DriverService ;
2627
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)} }
@@ -310,14 +321,6 @@ public Builder withReadableTimestamp(Boolean readableTimestamp) {
310321 return this ;
311322 }
312323
313- @ Override
314- protected File findDefaultExecutable () {
315- return findExecutable (
316- "chromedriver" , CHROME_DRIVER_EXE_PROPERTY ,
317- "https://chromedriver.chromium.org/" ,
318- "https://chromedriver.chromium.org/downloads" );
319- }
320-
321324 @ Override
322325 protected List <String > createArgs () {
323326 if (getLogFile () == null ) {
0 commit comments