@@ -72,22 +72,24 @@ public static EdgeDriverService CreateDefaultService()
7272        /// <summary> 
7373        /// Creates a default instance of the EdgeDriverService using a specified path to the EdgeDriver executable. 
7474        /// </summary> 
75-         /// <param name="driverPath">The directory containing the EdgeDriver executable.</param> 
75+         /// <param name="driverPath">The path to the executable or the  directory containing the EdgeDriver executable.</param> 
7676        /// <returns>An EdgeDriverService using a random port.</returns> 
77-         public  static   EdgeDriverService  CreateDefaultService ( string  driverPath ) 
77+         public  static   EdgeDriverService  CreateDefaultService ( string ?  driverPath ) 
7878        { 
79-             string  fileName ; 
8079            if  ( File . Exists ( driverPath ) ) 
8180            { 
82-                 fileName  =  Path . GetFileName ( driverPath ) ; 
83-                 driverPath  =  Path . GetDirectoryName ( driverPath ) ! ; 
81+                 string  fileName  =  Path . GetFileName ( driverPath ) ; 
82+                 string  driverFolder  =  Path . GetDirectoryName ( driverPath ) ! ; 
83+ 
84+                 return  CreateDefaultService ( driverFolder ,  fileName ) ; 
8485            } 
8586            else 
8687            { 
87-                 fileName  =  ChromiumDriverServiceFileName ( MSEdgeDriverServiceFileName ) ; 
88-             } 
88+                 string   fileName  =  ChromiumDriverServiceFileName ( MSEdgeDriverServiceFileName ) ; 
89+                  string ?   driverFolder   =   driverPath ; 
8990
90-             return  CreateDefaultService ( driverPath ,  fileName ) ; 
91+                 return  CreateDefaultService ( driverFolder ,  fileName ) ; 
92+             } 
9193        } 
9294
9395        /// <summary> 
@@ -96,7 +98,7 @@ public static EdgeDriverService CreateDefaultService(string driverPath)
9698        /// <param name="driverPath">The directory containing the EdgeDriver executable.</param> 
9799        /// <param name="driverExecutableFileName">The name of the EdgeDriver executable file.</param> 
98100        /// <returns>A EdgeDriverService using a random port.</returns> 
99-         public  static   EdgeDriverService  CreateDefaultService ( string  driverPath ,  string  driverExecutableFileName ) 
101+         public  static   EdgeDriverService  CreateDefaultService ( string ?  driverPath ,  string ?  driverExecutableFileName ) 
100102        { 
101103            return  new  EdgeDriverService ( driverPath ,  driverExecutableFileName ,  PortUtilities . FindFreePort ( ) ) ; 
102104        } 
0 commit comments