99using System . Reflection ;
1010using NUnit . Framework ;
1111using OpenQA . Selenium . Chromium ;
12+ using OpenQA . Selenium . Internal . Logging ;
1213
1314namespace OpenQA . Selenium . Environment
1415{
1516 public class DriverFactory
1617 {
18+ private static readonly ILogger log = Log . GetLogger < DriverFactory > ( ) ;
19+
1720 string driverPath ;
1821 string browserBinaryLocation ;
1922 private Dictionary < Browser , Type > serviceTypes = new Dictionary < Browser , Type > ( ) ;
@@ -55,6 +58,8 @@ public IWebDriver CreateDriver(Type driverType, bool logging = false)
5558
5659 public IWebDriver CreateDriverWithOptions ( Type driverType , DriverOptions driverOptions , bool logging = false )
5760 {
61+ log . Info ( $ "Creating driver of type { driverType } ") ;
62+
5863 Browser browser = Browser . All ;
5964 DriverService service = null ;
6065 DriverOptions options = null ;
@@ -180,7 +185,7 @@ protected void OnDriverLaunching(DriverService service, DriverOptions options)
180185 }
181186
182187
183- private T MergeOptions < T > ( object baseOptions , DriverOptions overriddenOptions ) where T : DriverOptions , new ( )
188+ private T MergeOptions < T > ( object baseOptions , DriverOptions overriddenOptions ) where T : DriverOptions , new ( )
184189 {
185190 // If the driver type has a static DefaultOptions property,
186191 // get the value of that property, which should be a valid
@@ -202,15 +207,15 @@ protected void OnDriverLaunching(DriverService service, DriverOptions options)
202207 return mergedOptions ;
203208 }
204209
205- private T CreateService < T > ( ) where T : DriverService
210+ private T CreateService < T > ( ) where T : DriverService
206211 {
207212 T service = default ( T ) ;
208213 Type serviceType = typeof ( T ) ;
209214
210215 MethodInfo createDefaultServiceMethod = serviceType . GetMethod ( "CreateDefaultService" , BindingFlags . Public | BindingFlags . Static , null , new Type [ ] { } , null ) ;
211216 if ( createDefaultServiceMethod != null && createDefaultServiceMethod . ReturnType == serviceType )
212217 {
213- service = ( T ) createDefaultServiceMethod . Invoke ( null , new object [ ] { } ) ;
218+ service = ( T ) createDefaultServiceMethod . Invoke ( null , new object [ ] { } ) ;
214219 }
215220
216221 return service ;
0 commit comments