Interface IBiDiDriverConfiguration
- Namespace
- WebDriverBiDi
- Assembly
- WebDriverBiDi.dll
Interface for configuring a WebDriver BiDi driver. This interface is implemented by BiDiDriver and can be used for testing, or to allow users to implement their own driver classes. It provides methods for registering modules and JSON type info resolvers. Event registration is not part of this interface; it is declared on IBiDiModuleHost, because a custom module registers its events through the module host it is constructed with.
public interface IBiDiDriverConfiguration
Remarks
This interface is not intended to be implemented by users of this library. It is exposed publicly to allow for testing and to allow users to implement their own driver classes if they choose. Normal usage of this library should involve using the BiDiDriver class, which provides a complete implementation. This interface should be used only by advanced users who are implementing custom driver behavior or for testing purposes.
Methods
RegisterModule(Module)
Registers a module for use with this driver.
void RegisterModule(Module module)
Parameters
moduleModuleThe module object.
RegisterTypeInfoResolverAsync(IJsonTypeInfoResolver, CancellationToken)
Registers an additional IJsonTypeInfoResolver for JSON serialization and deserialization. This allows custom types, such as those from user-defined modules, to be serialized in AOT scenarios where reflection-based serialization is unavailable.
Task RegisterTypeInfoResolverAsync(IJsonTypeInfoResolver resolver, CancellationToken cancellationToken = default)
Parameters
resolverIJsonTypeInfoResolverThe type info resolver to add.
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the asynchronous operation.
Returns
Exceptions
- ArgumentNullException
Thrown when
resolveris null.- ObjectDisposedException
Thrown if the driver has been disposed.
- InvalidOperationException
Thrown if the driver has already been started.
- WebDriverBiDiTimeoutException
Thrown when exclusive access to the transport's connection is not obtained within ConnectionLockTimeout.
- OperationCanceledException
Thrown when
cancellationTokenis canceled.