@@ -58,33 +58,6 @@ public abstract class DriverService : ICommandServer
58
58
/// </exception>
59
59
protected DriverService ( string servicePath , int port , string driverServiceExecutableName , Uri driverServiceDownloadUrl )
60
60
{
61
- if ( string . IsNullOrEmpty ( servicePath ) )
62
- {
63
- throw new ArgumentException ( "Path to locate driver executable cannot be null or empty." , nameof ( servicePath ) ) ;
64
- }
65
-
66
- string executablePath = Path . Combine ( servicePath , driverServiceExecutableName ) ;
67
- if ( ! File . Exists ( executablePath ) )
68
- {
69
- try
70
- {
71
- executablePath = SeleniumManager . DriverPath ( driverServiceExecutableName ) ;
72
- }
73
- catch ( Exception e )
74
- {
75
- // No-op; entirely a fall-back feature
76
- }
77
-
78
- if ( File . Exists ( executablePath ) )
79
- {
80
- servicePath = Path . GetDirectoryName ( executablePath ) ;
81
- }
82
- else
83
- {
84
- throw new DriverServiceNotFoundException ( string . Format ( CultureInfo . InvariantCulture , "The file {0} does not exist. The driver can be downloaded at {1}" , executablePath , driverServiceDownloadUrl ) ) ;
85
- }
86
- }
87
-
88
61
this . driverServicePath = servicePath ;
89
62
this . driverServiceExecutableName = driverServiceExecutableName ;
90
63
this . driverServicePort = port ;
@@ -194,11 +167,21 @@ public TimeSpan InitializationTimeout
194
167
}
195
168
196
169
/// <summary>
197
- /// Gets the executable file name of the driver service.
170
+ /// Gets or sets the executable file name of the driver service.
198
171
/// </summary>
199
- protected string DriverServiceExecutableName
172
+ public string DriverServiceExecutableName
200
173
{
201
174
get { return this . driverServiceExecutableName ; }
175
+ set { this . driverServiceExecutableName = value ; }
176
+ }
177
+
178
+ /// <summary>
179
+ /// Gets or sets the path of the driver service.
180
+ /// </summary>
181
+ public string DriverServicePath
182
+ {
183
+ get { return this . driverServicePath ; }
184
+ set { this . driverServicePath = value ; }
202
185
}
203
186
204
187
/// <summary>
@@ -312,28 +295,7 @@ public void Start()
312
295
/// </exception>
313
296
protected static string FindDriverServiceExecutable ( string executableName , Uri downloadUrl )
314
297
{
315
- string serviceDirectory = FileUtilities . FindFile ( executableName ) ;
316
-
317
- if ( string . IsNullOrEmpty ( serviceDirectory ) )
318
- {
319
- try
320
- {
321
- serviceDirectory = Path . GetDirectoryName ( SeleniumManager . DriverPath ( executableName ) ) ;
322
- }
323
- catch ( Exception e )
324
- {
325
- // No-op; entirely a fall-back feature
326
- }
327
-
328
- if ( string . IsNullOrEmpty ( serviceDirectory ) )
329
- {
330
- throw new DriverServiceNotFoundException ( string . Format ( CultureInfo . InvariantCulture ,
331
- "The {0} file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at {1}." ,
332
- executableName , downloadUrl ) ) ;
333
- }
334
- }
335
-
336
- return serviceDirectory ;
298
+ return FileUtilities . FindFile ( executableName ) ;
337
299
}
338
300
339
301
/// <summary>
0 commit comments