/// <summary> /// Registers the driver setup strategy factory. /// </summary> /// <param name="browserName">Name of the browser.</param> /// <param name="driverSetupStrategyFactory">The driver setup strategy factory.</param> public static void RegisterStrategyFactory( string browserName, Func <IHttpRequestExecutor, IDriverSetupStrategy> driverSetupStrategyFactory) { browserName.CheckNotNull(nameof(browserName)); driverSetupStrategyFactory.CheckNotNull(nameof(driverSetupStrategyFactory)); DriverSetupOptionsBuilder optionsBuilder = s_browserDriverSetupDataMap.TryGetValue(browserName, out DriverSetupData currentData) ? currentData.DefaultOptionsBuilder : new DriverSetupOptionsBuilder(new DriverSetupOptions(GlobalOptions)); s_browserDriverSetupDataMap[browserName] = new DriverSetupData(driverSetupStrategyFactory, optionsBuilder); }
/// <summary> /// Creates the driver setup configuration builder for the specified <paramref name="browserName"/>. /// Supported browser names are defined in <see cref="BrowserNames"/> static class. /// </summary> /// <param name="browserName">The browser name. Can be one of <see cref="BrowserNames"/> values.</param> /// <returns>The <see cref="DriverSetupConfigurationBuilder"/>.</returns> public static DriverSetupConfigurationBuilder Configure(string browserName) { DriverSetupData driverSetupData = GetDriverSetupData(browserName); return(Configure(browserName, driverSetupData.StrategyFactory, driverSetupData.DefaultOptionsBuilder.BuildingContext)); }