Class DriverTypeProvider
- Namespace
- CSF.Extensions.WebDriver.Factories
- Assembly
- CSF.Extensions.WebDriver.dll
Default implementation of IGetsDriverType.
public class DriverTypeProvider : IGetsDriverType
- Inheritance
-
DriverTypeProvider
- Implements
- Inherited Members
Constructors
DriverTypeProvider(ILogger<DriverTypeProvider>, IGetsWebDriverAndOptionsTypes)
Initialises a new instance of DriverTypeProvider.
public DriverTypeProvider(ILogger<DriverTypeProvider> logger, IGetsWebDriverAndOptionsTypes typeProvider)
Parameters
loggerILogger<DriverTypeProvider>A logger
typeProviderIGetsWebDriverAndOptionsTypesA provider for the concrete types of web driver and options
Exceptions
- ArgumentNullException
If any parameter is null
Methods
TryGetDriverType(WebDriverCreationOptions, IConfigurationSection, out Type)
Validates and gets the Type of the implementation of OpenQA.Selenium.IWebDriver implementation indicated by the configuration.
public bool TryGetDriverType(WebDriverCreationOptions options, IConfigurationSection configuration, out Type driverType)
Parameters
optionsWebDriverCreationOptionsThe options, as they have been parsed so far
configurationIConfigurationSectionThe configuration section
driverTypeTypeIf this method returns true then this is a Type of the web driver, otherwise this value is undefined and must be ignored.
Returns
Remarks
Note that it is valid for the driver type to be null if DriverFactoryType is specified. In that scenario, the driver type is unused, but it still indicates a valid configuration.