Class SeleniumWebHostBuilderExtensions

Namespace
ProtoTest.Web
Assembly
ProtoTest.Web.Selenium.dll

Selenium registration for IProtoHostBuilder. Reference the ProtoTest.Web.Selenium package and call AddWeb(...); the backend is implied by the referenced package. Sessions are created per test via Proto.Context.Web(name). The driver a session creates is owned by ProtoTest: it is quit and disposed when the session completes, so the factory must return a fresh driver rather than a shared one.

public static class SeleniumWebHostBuilderExtensions
Inheritance
SeleniumWebHostBuilderExtensions
Inherited Members

Methods

AddWeb(IProtoApplicationBuilder, Func<IWebDriver>, Action<SeleniumWebOptions>?)

Exposes web under an application. The application's sessions share this backend.

public static IProtoApplicationBuilder AddWeb(this IProtoApplicationBuilder application, Func<IWebDriver> createDriver, Action<SeleniumWebOptions>? configure = null)

Parameters

application IProtoApplicationBuilder
createDriver Func<IWebDriver>
configure Action<SeleniumWebOptions>

Returns

IProtoApplicationBuilder

AddWeb(IProtoHostBuilder, Func<IWebDriver>, Action<SeleniumWebOptions>?)

Adds a Selenium-backed web host.

public static IProtoHostBuilder AddWeb(this IProtoHostBuilder builder, Func<IWebDriver> createDriver, Action<SeleniumWebOptions>? configure = null)

Parameters

builder IProtoHostBuilder

The host builder.

createDriver Func<IWebDriver>

Creates a fresh WebDriver for each session. ProtoTest owns it: the session quits and disposes it, so returning a shared driver would tear it down under later tests.

configure Action<SeleniumWebOptions>

Optional callback to configure Selenium options for every session.

Returns

IProtoHostBuilder