मुख्य कॉन्टेंट में जाएँ

WebDriver Bidi Protocol

These protocol commands are generated based on the current living WebDriver Bidi specification. To enable the protocol for your test make sure to have webSocketUrl: true set in your capabilities.

Use with Caution!

Browser support is not guaranteed and interfaces can change in the future. The standard is currently under development and browser vendors will add these capabilities based on their own timelines.

Last Updated: Tue Jun 18 2024 17:48:53 GMT+0000 (Coordinated Universal Time)


send

Send socket commands via WebDriver Bidi

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.send(params)
Parameters
NameTypeDetails
paramsCommandDatasocket payload
Returns
  • <Object> CommandResponse: WebDriver Bidi response

sendAsync

Send asynchronous socket commands via WebDriver Bidi

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.sendAsync(params)
Parameters
NameTypeDetails
paramsCommandDatasocket payload
Returns
  • <Number> id: id of WebDriver Bidi request

sessionStatus

WebDriver Bidi command to send command method "session.status" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.sessionStatus(params)
Parameters
NameTypeDetails
paramsremote.EmptyParams
{}
Returns
  • <Object> local.SessionStatusResult: Command return value with the following interface:
    {
    ready: boolean;
    message: string;
    }

sessionNew

WebDriver Bidi command to send command method "session.new" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.sessionNew(params)
Parameters
NameTypeDetails
paramsremote.SessionNewParameters
{
capabilities: SessionCapabilitiesRequest;
}
Returns
  • <Object> local.SessionNewResult: Command return value with the following interface:
    {
    sessionId: string;
    capabilities: {
    acceptInsecureCerts: boolean;
    browserName: string;
    browserVersion: string;
    platformName: string;
    proxy: {
    proxyType?: "pac" | "direct" | "autodetect" | "system" | "manual";
    proxyAutoconfigUrl?: string;
    ftpProxy?: string;
    httpProxy?: string;
    noProxy?: string[];
    sslProxy?: string;
    socksProxy?: string;
    socksVersion?: number;
    };
    setWindowRect: boolean;
    };
    }

sessionEnd

WebDriver Bidi command to send command method "session.end" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.sessionEnd(params)
Parameters
NameTypeDetails
paramsremote.EmptyParams
{}

sessionSubscribe

WebDriver Bidi command to send command method "session.subscribe" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.sessionSubscribe(params)
Parameters
NameTypeDetails
paramsremote.SessionSubscriptionRequest
{
events: string[];
contexts?: BrowsingContextBrowsingContext[];
}

sessionUnsubscribe

WebDriver Bidi command to send command method "session.unsubscribe" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.sessionUnsubscribe(params)
Parameters
NameTypeDetails
paramsremote.SessionSubscriptionRequest
{
events: string[];
contexts?: BrowsingContextBrowsingContext[];
}

browserClose

WebDriver Bidi command to send command method "browser.close" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browserClose(params)
Parameters
NameTypeDetails
paramsremote.EmptyParams
{}

browsingContextActivate

WebDriver Bidi command to send command method "browsingContext.activate" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextActivate(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextActivateParameters
{
context: BrowsingContextBrowsingContext;
}

browsingContextCaptureScreenshot

WebDriver Bidi command to send command method "browsingContext.captureScreenshot" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextCaptureScreenshot(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextCaptureScreenshotParameters
{
context: BrowsingContextBrowsingContext;
/**
* @default 'viewport'
*/
origin?: "viewport" | "document";
format?: BrowsingContextImageFormat;
clip?: BrowsingContextClipRectangle;
}
Returns
  • <Object> local.BrowsingContextCaptureScreenshotResult: Command return value with the following interface:
    {
    data: string;
    }

browsingContextClose

WebDriver Bidi command to send command method "browsingContext.close" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextClose(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextCloseParameters
{
context: BrowsingContextBrowsingContext;
promptUnload?: boolean;
}

browsingContextCreate

WebDriver Bidi command to send command method "browsingContext.create" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextCreate(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextCreateParameters
{
type: BrowsingContextCreateType;
referenceContext?: BrowsingContextBrowsingContext;
background?: boolean;
}
Returns
  • <Object> local.BrowsingContextCreateResult: Command return value with the following interface:
    {
    context: BrowsingContextBrowsingContext;
    }

browsingContextGetTree

WebDriver Bidi command to send command method "browsingContext.getTree" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextGetTree(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextGetTreeParameters
{
maxDepth?: JsUint;
root?: BrowsingContextBrowsingContext;
}
Returns
  • <Object> local.BrowsingContextGetTreeResult: Command return value with the following interface:
    {
    contexts: BrowsingContextInfoList;
    }

browsingContextHandleUserPrompt

WebDriver Bidi command to send command method "browsingContext.handleUserPrompt" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextHandleUserPrompt(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextHandleUserPromptParameters
{
context: BrowsingContextBrowsingContext;
accept?: boolean;
userText?: string;
}

browsingContextLocateNodes

WebDriver Bidi command to send command method "browsingContext.locateNodes" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextLocateNodes(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextLocateNodesParameters
{
context: BrowsingContextBrowsingContext;
locator: BrowsingContextLocator;
maxNodeCount?: JsUint;
ownership?: ScriptResultOwnership;
sandbox?: string;
serializationOptions?: ScriptSerializationOptions;
startNodes?: ScriptSharedReference[];
}
Returns
  • <Object> local.BrowsingContextLocateNodesResult: Command return value with the following interface:
    {
    nodes: ScriptNodeRemoteValue[];
    }

browsingContextNavigate

WebDriver Bidi command to send command method "browsingContext.navigate" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextNavigate(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextNavigateParameters
{
context: BrowsingContextBrowsingContext;
url: string;
wait?: BrowsingContextReadinessState;
}
Returns
  • <Object> local.BrowsingContextNavigateResult: Command return value with the following interface:
    {
    navigation: BrowsingContextNavigation | null;
    url: string;
    }

browsingContextPrint

WebDriver Bidi command to send command method "browsingContext.print" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextPrint(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextPrintParameters
{
context: BrowsingContextBrowsingContext;
background?: boolean;
margin?: BrowsingContextPrintMarginParameters;
/**
* @default 'portrait'
*/
orientation?: "portrait" | "landscape";
page?: BrowsingContextPrintPageParameters;
pageRanges?: (JsUint | string)[];
/**
* @default 1
*/
scale?: number;
/**
* @default true
*/
shrinkToFit?: boolean;
}
Returns
  • <Object> local.BrowsingContextPrintResult: Command return value with the following interface:
    {
    data: string;
    }

browsingContextReload

WebDriver Bidi command to send command method "browsingContext.reload" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextReload(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextReloadParameters
{
context: BrowsingContextBrowsingContext;
ignoreCache?: boolean;
wait?: BrowsingContextReadinessState;
}

browsingContextSetViewport

WebDriver Bidi command to send command method "browsingContext.setViewport" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextSetViewport(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextSetViewportParameters
{
context: BrowsingContextBrowsingContext;
viewport?: BrowsingContextViewport | null;
devicePixelRatio?: number | null;
}

browsingContextTraverseHistory

WebDriver Bidi command to send command method "browsingContext.traverseHistory" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.browsingContextTraverseHistory(params)
Parameters
NameTypeDetails
paramsremote.BrowsingContextTraverseHistoryParameters
{
context: BrowsingContextBrowsingContext;
delta: JsInt;
}

networkAddIntercept

WebDriver Bidi command to send command method "network.addIntercept" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.networkAddIntercept(params)
Parameters
NameTypeDetails
paramsremote.NetworkAddInterceptParameters
{
phases: NetworkInterceptPhase[];
urlPatterns?: NetworkUrlPattern[];
}
Returns
  • <Object> local.NetworkAddInterceptResult: Command return value with the following interface:
    {
    intercept: NetworkIntercept;
    }

networkContinueRequest

WebDriver Bidi command to send command method "network.continueRequest" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.networkContinueRequest(params)
Parameters
NameTypeDetails
paramsremote.NetworkContinueRequestParameters
{
request: NetworkRequest;
body?: NetworkBytesValue;
cookies?: NetworkCookieHeader[];
headers?: NetworkHeader[];
method?: string;
url?: string;
}

networkContinueResponse

WebDriver Bidi command to send command method "network.continueResponse" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.networkContinueResponse(params)
Parameters
NameTypeDetails
paramsremote.NetworkContinueResponseParameters
{
request: NetworkRequest;
cookies?: NetworkSetCookieHeader[];
credentials?: NetworkAuthCredentials;
headers?: NetworkHeader[];
reasonPhrase?: string;
statusCode?: JsUint;
}

networkContinueWithAuth

WebDriver Bidi command to send command method "network.continueWithAuth" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.networkContinueWithAuth(params)
Parameters
NameTypeDetails
paramsremote.NetworkContinueWithAuthParameters
{
request: NetworkRequest;
}

networkFailRequest

WebDriver Bidi command to send command method "network.failRequest" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.networkFailRequest(params)
Parameters
NameTypeDetails
paramsremote.NetworkFailRequestParameters
{
request: NetworkRequest;
}

networkProvideResponse

WebDriver Bidi command to send command method "network.provideResponse" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.networkProvideResponse(params)
Parameters
NameTypeDetails
paramsremote.NetworkProvideResponseParameters
{
request: NetworkRequest;
body?: NetworkBytesValue;
cookies?: NetworkSetCookieHeader[];
headers?: NetworkHeader[];
reasonPhrase?: string;
statusCode?: JsUint;
}

networkRemoveIntercept

WebDriver Bidi command to send command method "network.removeIntercept" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.networkRemoveIntercept(params)
Parameters
NameTypeDetails
paramsremote.NetworkRemoveInterceptParameters
{
intercept: NetworkIntercept;
}

scriptAddPreloadScript

WebDriver Bidi command to send command method "script.addPreloadScript" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.scriptAddPreloadScript(params)
Parameters
NameTypeDetails
paramsremote.ScriptAddPreloadScriptParameters
{
functionDeclaration: string;
arguments?: ScriptChannelValue[];
contexts?: BrowsingContextBrowsingContext[];
sandbox?: string;
}
Returns
  • <Object> local.ScriptAddPreloadScriptResult: Command return value with the following interface:
    {
    script: ScriptPreloadScript;
    }

scriptDisown

WebDriver Bidi command to send command method "script.disown" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.scriptDisown(params)
Parameters
NameTypeDetails
paramsremote.ScriptDisownParameters
{
handles: ScriptHandle[];
target: ScriptTarget;
}

scriptCallFunction

WebDriver Bidi command to send command method "script.callFunction" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.scriptCallFunction(params)
Parameters
NameTypeDetails
paramsremote.ScriptCallFunctionParameters
{
functionDeclaration: string;
awaitPromise: boolean;
target: ScriptTarget;
arguments?: ScriptLocalValue[];
resultOwnership?: ScriptResultOwnership;
serializationOptions?: ScriptSerializationOptions;
this?: ScriptLocalValue;
userActivation?: boolean;
}

scriptEvaluate

WebDriver Bidi command to send command method "script.evaluate" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.scriptEvaluate(params)
Parameters
NameTypeDetails
paramsremote.ScriptEvaluateParameters
{
expression: string;
target: ScriptTarget;
awaitPromise: boolean;
resultOwnership?: ScriptResultOwnership;
serializationOptions?: ScriptSerializationOptions;
userActivation?: boolean;
}
Returns
  • <Object> local.ScriptEvaluateResult: Command return value with the following interface:
    ;

scriptGetRealms

WebDriver Bidi command to send command method "script.getRealms" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.scriptGetRealms(params)
Parameters
NameTypeDetails
paramsremote.ScriptGetRealmsParameters
{
context?: BrowsingContextBrowsingContext;
type?: ScriptRealmType;
}
Returns
  • <Object> local.ScriptGetRealmsResult: Command return value with the following interface:
    {
    realms: ScriptRealmInfo[];
    }

scriptRemovePreloadScript

WebDriver Bidi command to send command method "script.removePreloadScript" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.scriptRemovePreloadScript(params)
Parameters
NameTypeDetails
paramsremote.ScriptRemovePreloadScriptParameters
{
script: ScriptPreloadScript;
}

inputPerformActions

WebDriver Bidi command to send command method "input.performActions" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.inputPerformActions(params)
Parameters
NameTypeDetails
paramsremote.InputPerformActionsParameters
{
context: BrowsingContextBrowsingContext;
actions: InputSourceActions[];
}

inputReleaseActions

WebDriver Bidi command to send command method "input.releaseActions" with parameters.

WebDriver Bidi Protocol command. More details can be found in the official protocol docs.

Usage
browser.inputReleaseActions(params)
Parameters
NameTypeDetails
paramsremote.InputReleaseActionsParameters
{
context: BrowsingContextBrowsingContext;
}

Welcome! How can I help?

WebdriverIO AI Copilot