Table of Contents

Interface IBiDiDriverEvents

Namespace
WebDriverBiDi
Assembly
WebDriverBiDi.dll

Interface for a driver that exposes events related to WebDriver BiDi protocol communication. This interface is implemented by BiDiDriver and can be used for testing, or to allow users to implement their own driver classes. It provides observable events for protocol events, errors received, unknown messages, errors in observers, log messages, and the loss of the connection.

public interface IBiDiDriverEvents

Remarks

The log level and the error-handling behaviors that used to sit here are settings of the transport rather than events, and are reached through TransportConfiguration.

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.

Properties

OnConnectionLost

Gets an observable event that notifies when an established connection ends without the client stopping it: the remote end closed it, or it failed.

ObservableEvent<ConnectionLostEventArgs> OnConnectionLost { get; }

Property Value

ObservableEvent<ConnectionLostEventArgs>

OnEventHandlerErrorOccurred

Gets an observable event that notifies when an error occurs in an observer of an observable event.

ObservableEvent<EventHandlerErrorOccurredEventArgs> OnEventHandlerErrorOccurred { get; }

Property Value

ObservableEvent<EventHandlerErrorOccurredEventArgs>

Remarks

This event is for diagnostic and observability purposes, and does not prevent the propagation of the error back to the Transport class.

OnEventReceived

Gets an observable event that notifies when a protocol event is received from protocol transport.

ObservableEvent<EventReceivedEventArgs> OnEventReceived { get; }

Property Value

ObservableEvent<EventReceivedEventArgs>

OnLogMessage

Gets an observable event that notifies when a log message is emitted by this driver.

ObservableEvent<LogMessageEventArgs> OnLogMessage { get; }

Property Value

ObservableEvent<LogMessageEventArgs>

OnUnexpectedErrorReceived

Gets an observable event that notifies when a protocol error is received from protocol transport.

ObservableEvent<ErrorReceivedEventArgs> OnUnexpectedErrorReceived { get; }

Property Value

ObservableEvent<ErrorReceivedEventArgs>

OnUnknownMessageReceived

Gets an observable event that notifies when an unknown message is received from protocol transport.

ObservableEvent<UnknownMessageReceivedEventArgs> OnUnknownMessageReceived { get; }

Property Value

ObservableEvent<UnknownMessageReceivedEventArgs>

Methods

IsLogLevelEnabled(WebDriverBiDiLogLevel)

Gets a value indicating whether a message at the given level would be raised on OnLogMessage, so that a caller can avoid building a message that would be discarded.

bool IsLogLevelEnabled(WebDriverBiDiLogLevel level)

Parameters

level WebDriverBiDiLogLevel

The WebDriverBiDiLogLevel of the message the caller would raise.

Returns

bool

true if such a message would be raised; otherwise, false.