Zum Hauptinhalt springen

WebDriver Bidi Protocol

These protocol commands are generated based on the current living WebDriver Bidi specification.

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 Sep 19 2023 17:28:42 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
{}

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;
}
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;
}

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;
}
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;
}

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;
}

scriptAddPreloadScriptCommand

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.scriptAddPreloadScriptCommand(params)
Parameters
NameTypeDetails
paramsremote.ScriptAddPreloadScriptParameters
{
functionDeclaration: string;
arguments?: ScriptChannelValue[];
sandbox?: string;
}

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?: ScriptArgumentValue[];
resultOwnership?: ScriptResultOwnership;
serializationOptions?: ScriptSerializationOptions;
this?: ScriptArgumentValue;
}

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;
}
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[];
    }

scriptRemovePreloadScriptCommand

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.scriptRemovePreloadScriptCommand(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