Table of Contents

Class BiDiOptionsBuilder

Namespace
OpenQA.Selenium.BiDi
Assembly
Selenium.WebDriver.dll

Provides a fluent API for configuring BiDi connection options, such as the underlying transport mechanism.

public sealed class BiDiOptionsBuilder
Inheritance
BiDiOptionsBuilder
Inherited Members

Methods

UseTransport(Func<ITransport>)

Configures the BiDi connection to use a transport created by the specified factory.

public BiDiOptionsBuilder UseTransport(Func<ITransport> factory)

Parameters

factory Func<ITransport>

A factory function that creates the ITransport instance.

Returns

BiDiOptionsBuilder

The current BiDiOptionsBuilder instance for chaining.

Remarks

BiDi takes ownership of the transport instance returned by the factory and will dispose it.

UseWebSocket(Action<ClientWebSocketOptions>?)

Configures the BiDi connection to use a WebSocket transport.

public BiDiOptionsBuilder UseWebSocket(Action<ClientWebSocketOptions>? configure = null)

Parameters

configure Action<ClientWebSocketOptions>

An optional action to configure the ClientWebSocketOptions before connecting.

Returns

BiDiOptionsBuilder

The current BiDiOptionsBuilder instance for chaining.

Remarks

WebSocket is the default transport; calling this method is only necessary when you need to customize the underlying ClientWebSocketOptions (e.g., to set headers, proxy, or certificates).