Table of Contents

Interface IGetsWebDriverAndOptionsTypes

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

An object which gets the OpenQA.Selenium.IWebDriver and OpenQA.Selenium.DriverOptions types.

public interface IGetsWebDriverAndOptionsTypes

Methods

GetWebDriverFactoryType(string)

Gets the Type for an implementation of ICreatesWebDriverFromOptions, for when a third-party factory is to be used.

Type GetWebDriverFactoryType(string typeName)

Parameters

typeName string

The assembly qualified name of the factory type.

Returns

Type

Exceptions

ArgumentException

If typeName is null or whitespace, or if it corresponds to a type which does not implement ICreatesWebDriverFromOptions.

TypeLoadException

If the type specified by typeName cannot be loaded.

GetWebDriverOptionsType(Type, string)

Gets the Type for an implementation of OpenQA.Selenium.DriverOptions from an optional string type name and the implementation-type of the OpenQA.Selenium.IWebDriver which will be consuming those options.

Type GetWebDriverOptionsType(Type driverType, string typeName = null)

Parameters

driverType Type

The type of OpenQA.Selenium.IWebDriver which will be consuming these options.

typeName string

An optional name of a type which implements OpenQA.Selenium.DriverOptions; see the remarks for more information.

Returns

Type

A DriverOptions type.

Remarks

Under some circumstances, the typeName parameter may be null and the type will still be correctly determined. That is because a number of OpenQA.Selenium.IWebDriver implementation types imply a deterministic OpenQA.Selenium.DriverOptions type via their constructor signature.

For such WebDriver implementation types, if the type name is omitted then the options type will be returned based upon the implied options type, which the driver type takes in its constructor.

Additionally, for all concrete OpenQA.Selenium.DriverOptions implementations which are shipped with Selenium, when typeName is specified it needs only be a short type name, equivalent to Name. For third-party driver options implementations, this must be an assembly-qualified name, such that the type may be found using GetType(string).

Exceptions

ArgumentNullException

If driverType is null.

ArgumentException

If typeName is specified, but does not correspond to a type which derives from OpenQA.Selenium.DriverOptions, or if typeName is null but the driverType is not a type which implies a driver options type.

TypeLoadException

If the type specified by typeName cannot be loaded.

GetWebDriverType(string)

Gets the Type for an implementation of OpenQA.Selenium.IWebDriver, from a string type name.

Type GetWebDriverType(string typeName)

Parameters

typeName string

The name of the type.

Returns

Type

A WebDriver type.

Remarks

For WebDriver implementations which are shipped with Selenium, all that is required is the short name, corresponding to Name. For WebDriver implementations that are not part of the Selenium.WebDriver NuGet package, this should be an assembly-qualified type name, such that the type could be located with GetType(string).

Exceptions

ArgumentException

If typeName is null or whitespace, or if it corresponds to a type which does not implement OpenQA.Selenium.IWebDriver.

TypeLoadException

If the type specified by typeName cannot be loaded.