Table of Contents

Class OptionsTypeProvider

Namespace
CSF.Extensions.WebDriver.Factories
Assembly
CSF.Extensions.WebDriver.dll

Default implementation of IGetsOptionsType.

public class OptionsTypeProvider : IGetsOptionsType
Inheritance
OptionsTypeProvider
Implements
Inherited Members

Constructors

OptionsTypeProvider(ILogger<OptionsTypeProvider>, IGetsWebDriverAndOptionsTypes, ICreatesDriverOptions)

Initialises a new instance of DriverTypeProvider.

public OptionsTypeProvider(ILogger<OptionsTypeProvider> logger, IGetsWebDriverAndOptionsTypes typeProvider, ICreatesDriverOptions optionsFactory)

Parameters

logger ILogger<OptionsTypeProvider>

A logger

typeProvider IGetsWebDriverAndOptionsTypes

A provider for the concrete types of web driver and options

optionsFactory ICreatesDriverOptions

A factory for instances of OpenQA.Selenium.DriverOptions

Exceptions

ArgumentNullException

If any parameter is null

Methods

TryGetOptionsType(WebDriverCreationOptions, IConfigurationSection, Type, out Type)

Validates and gets the Type of the implementation of OpenQA.Selenium.DriverOptions implementation indicated by the configuration.

public bool TryGetOptionsType(WebDriverCreationOptions options, IConfigurationSection configuration, Type driverType, out Type optionsType)

Parameters

options WebDriverCreationOptions

The options, as they have been parsed so far

configuration IConfigurationSection

The configuration section

driverType Type

The type of the Web Driver, as has already been determined by TryGetDriverType(WebDriverCreationOptions, IConfigurationSection, out Type).

optionsType Type

If this method returns true then this is a Type of the driver options, 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 options type to be null if DriverFactoryType is specified. In that scenario, the options type is unused, but it still indicates a valid configuration.