Table of Contents

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

logger ILogger<DriverTypeProvider>

A logger

typeProvider IGetsWebDriverAndOptionsTypes

A 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

options WebDriverCreationOptions

The options, as they have been parsed so far

configuration IConfigurationSection

The configuration section

driverType Type

If this method returns true then this is a Type of the web driver, otherwise this value is undefined and must be ignored.

Returns

bool

true if the driver type information is valid; false if not

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.