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<Func<Uri, CancellationToken, Task<ITransport>>, Func<Uri, CancellationToken, Task<ITransport>>>)

Composes a transport factory into the current transport pipeline.

public BiDiOptionsBuilder UseTransport(Func<Func<Uri, CancellationToken, Task<ITransport>>, Func<Uri, CancellationToken, Task<ITransport>>> next)

Parameters

next Func<Func<Uri, CancellationToken, Task<ITransport>>, Func<Uri, CancellationToken, Task<ITransport>>>

A callback that composes a new transport factory from the current one.

Returns

BiDiOptionsBuilder

The current BiDiOptionsBuilder instance for chaining.

Remarks

The next callback receives the current transport factory and returns the next factory in the chain. BiDi takes ownership of the transport instance returned by the final 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).