Table of Contents

Class Network

Namespace
OpenQA.Selenium.DevTools
Assembly
WebDriver.dll

Class providing functionality for manipulating network calls using DevTools Protocol commands

public abstract class Network
Inheritance
Network
Derived
Inherited Members

Methods

AddResponseBody(HttpResponseData)

Asynchronously adds the response body to the provided HttpResponseData object.

public abstract Task AddResponseBody(HttpResponseData responseData)

Parameters

responseData HttpResponseData

The HttpResponseData object to which to add the response body.

Returns

Task

A task that represents the asynchronous operation.

CancelAuth(string)

Asynchronously cancels authorization of an intercepted network request.

public abstract Task CancelAuth(string requestId)

Parameters

requestId string

The ID of the network request for which to cancel authentication.

Returns

Task

A task that represents the asynchronous operation.

ContinueRequest(HttpRequestData)

Asynchronously continues an intercepted network request.

public abstract Task ContinueRequest(HttpRequestData requestData)

Parameters

requestData HttpRequestData

The HttpRequestData of the request.

Returns

Task

A task that represents the asynchronous operation.

ContinueRequestWithResponse(HttpRequestData, HttpResponseData)

Asynchronously continues an intercepted network request and returns the specified response.

public abstract Task ContinueRequestWithResponse(HttpRequestData requestData, HttpResponseData responseData)

Parameters

requestData HttpRequestData

The HttpRequestData of the request.

responseData HttpResponseData

The HttpResponseData with which to respond to the request

Returns

Task

A task that represents the asynchronous operation.

ContinueRequestWithoutModification(HttpRequestData)

Asynchronously contines an intercepted network request without modification.

public abstract Task ContinueRequestWithoutModification(HttpRequestData requestData)

Parameters

requestData HttpRequestData

The HttpRequestData of the network request.

Returns

Task

A task that represents the asynchronous operation.

ContinueResponseWithoutModification(HttpResponseData)

Asynchronously continues an intercepted network response without modification.

public abstract Task ContinueResponseWithoutModification(HttpResponseData responseData)

Parameters

responseData HttpResponseData

The HttpResponseData of the network response.

Returns

Task

A task that represents the asynchronous operation.

ContinueWithAuth(string, string, string)

Asynchronously continues an intercepted network call using authentication.

public abstract Task ContinueWithAuth(string requestId, string userName, string password)

Parameters

requestId string

The ID of the network request for which to continue with authentication.

userName string

The user name with which to authenticate.

password string

The password with which to authenticate.

Returns

Task

A task that represents the asynchronous operation.

DisableFetch()

Asynchronously diables the fetch domain.

public abstract Task DisableFetch()

Returns

Task

A task that represents the asynchronous operation.

DisableNetwork()

Asynchronously diables the fetch domain.

public abstract Task DisableNetwork()

Returns

Task

A task that represents the asynchronous operation.

DisableNetworkCaching()

Asynchronously disables network caching.

public abstract Task DisableNetworkCaching()

Returns

Task

A task that represents the asynchronous operation.

EnableFetchForAllPatterns()

Asynchronously enables the fetch domain for all URL patterns.

public abstract Task EnableFetchForAllPatterns()

Returns

Task

A task that represents the asynchronous operation.

EnableNetwork()

Asynchronously enables the network domain.

public abstract Task EnableNetwork()

Returns

Task

A task that represents the asynchronous operation.

EnableNetworkCaching()

Asynchronously enables network caching.

public abstract Task EnableNetworkCaching()

Returns

Task

A task that represents the asynchronous operation.

OnAuthRequired(AuthRequiredEventArgs)

Raises the AuthRequired event.

protected virtual void OnAuthRequired(AuthRequiredEventArgs e)

Parameters

e AuthRequiredEventArgs

An AuthRequiredEventArgs that contains the event data.

OnRequestPaused(RequestPausedEventArgs)

Raises the RequestPaused event.

protected virtual void OnRequestPaused(RequestPausedEventArgs e)

Parameters

e RequestPausedEventArgs

An RequestPausedEventArgs that contains the event data.

OnResponsePaused(ResponsePausedEventArgs)

Raises the ResponseReceived event.

protected virtual void OnResponsePaused(ResponsePausedEventArgs e)

Parameters

e ResponsePausedEventArgs

An ResponsePausedEventArgs that contains the event data.

SetUserAgentOverride(UserAgent)

Asynchronously sets the override of the user agent settings.

public abstract Task SetUserAgentOverride(UserAgent userAgent)

Parameters

userAgent UserAgent

A UserAgent object containing the user agent values to override.

Returns

Task

A task that represents the asynchronous operation.

SetUserAgentOverride(string)

Asynchronously sets the override of the user agent string.

public Task SetUserAgentOverride(string userAgent)

Parameters

userAgent string

The user agent string to set.

Returns

Task

A task that represents the asynchronous operation.

Events

AuthRequired

Occurs when a network request requires authorization.

public event Network.AsyncEventHandler<AuthRequiredEventArgs> AuthRequired

Event Type

Network.AsyncEventHandler<AuthRequiredEventArgs>

RequestPaused

Occurs when a network request is intercepted.

public event Network.AsyncEventHandler<RequestPausedEventArgs> RequestPaused

Event Type

Network.AsyncEventHandler<RequestPausedEventArgs>

ResponsePaused

Occurs when a network response is received.

public event Network.AsyncEventHandler<ResponsePausedEventArgs> ResponsePaused

Event Type

Network.AsyncEventHandler<ResponsePausedEventArgs>