# WebDriver Protocol

## newSession[​](#newsession "Direct link to newSession")

The New Session command creates a new WebDriver session with the endpoint node. If the creation fails, a session not created error is returned.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-new-sessions).

### Usage[​](#usage "Direct link to Usage")

```
await browser.newSession(capabilities)
```

### Parameters[​](#parameters "Direct link to Parameters")

| Name           | Type     | Details                                                                                                              |
| -------------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `capabilities` | `object` | a JSON object, the set of capabilities that was ultimately merged and matched in the capability processing algorithm |

### Returns[​](#returns "Direct link to Returns")

* **\<Object>** **`session`:** Object containing sessionId and capabilities of created WebDriver session.

***

## deleteSession[​](#deletesession "Direct link to deleteSession")

The Delete Session command closes any top-level browsing contexts associated with the current session, terminates the connection, and finally closes the current session.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-delete-session).

### Usage[​](#usage-1 "Direct link to Usage")

```
await browser.deleteSession(deleteSessionOpts)
```

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Name                                | Type     | Details                                                                                     |
| ----------------------------------- | -------- | ------------------------------------------------------------------------------------------- |
| `deleteSessionOpts`<br />*optional* | `object` | Object containing options for the deleteSession command, e.g. `{ shutdownDriver: boolean }` |

***

## status[​](#status "Direct link to status")

The Status command returns information about whether a remote end is in a state in which it can create new sessions and can additionally include arbitrary meta information that is specific to the implementation.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-status).

### Usage[​](#usage-2 "Direct link to Usage")

```
await browser.status()
```

### Example[​](#example "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L5-L16)

### Returns[​](#returns-1 "Direct link to Returns")

* **\<Object>** **`status`:** Object containing status of the driver status.

***

## getTimeouts[​](#gettimeouts "Direct link to getTimeouts")

The Get Timeouts command gets timeout durations associated with the current session.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-timeouts).

### Usage[​](#usage-3 "Direct link to Usage")

```
await browser.getTimeouts()
```

### Example[​](#example-1 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L20-L24)

### Returns[​](#returns-2 "Direct link to Returns")

* **\<Object>** **`timeouts`:** Object containing timeout durations for `script`, `pageLoad` and `implicit` timeouts.

***

## setTimeouts[​](#settimeouts "Direct link to setTimeouts")

The Set Timeouts command sets timeout durations associated with the current session. The timeouts that can be controlled are listed in the table of session timeouts below.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-set-timeouts).

### Usage[​](#usage-4 "Direct link to Usage")

```
await browser.setTimeouts(implicit, pageLoad, script)
```

### Parameters[​](#parameters-2 "Direct link to Parameters")

| Name                       | Type           | Details                                         |
| -------------------------- | -------------- | ----------------------------------------------- |
| `implicit`<br />*optional* | `number, null` | integer in ms for session implicit wait timeout |
| `pageLoad`<br />*optional* | `number, null` | integer in ms for session page load timeout     |
| `script`<br />*optional*   | `number, null` | integer in ms for session script timeout        |

### Example[​](#example-2 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L28-L33)

***

## getUrl[​](#geturl "Direct link to getUrl")

The Get Current URL command returns the URL of the current top-level browsing context.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-current-url).

### Usage[​](#usage-5 "Direct link to Usage")

```
await browser.getUrl()
```

### Example[​](#example-3 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L39-L43)

### Returns[​](#returns-3 "Direct link to Returns")

* **\<string>** **`url`:** current top-level browsing context’s active document’s document URL

***

## navigateTo[​](#navigateto "Direct link to navigateTo")

The navigateTo (go) command is used to cause the user agent to navigate the current top-level browsing context a new location.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-navigate-to).

info

This protocol command is embedded in the following convenient method: [url](/docs/api/browser/url.md). It is recommended to use this command instead.

### Usage[​](#usage-6 "Direct link to Usage")

```
await browser.navigateTo(url)
```

### Parameters[​](#parameters-3 "Direct link to Parameters")

| Name  | Type     | Details                                                                                                                                       |
| ----- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `url` | `string` | string representing an absolute URL (beginning with http(s)), possibly including a fragment (#...), could also be a local scheme (about: etc) |

### Example[​](#example-4 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L47-L51)

***

## back[​](#back "Direct link to back")

The Back command causes the browser to traverse one step backward in the joint session history of the current top-level browsing context. This is equivalent to pressing the back button in the browser chrome or calling `window.history.back`.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-back).

### Usage[​](#usage-7 "Direct link to Usage")

```
await browser.back()
```

### Example[​](#example-5 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L55-L59)

***

## forward[​](#forward "Direct link to forward")

The Forward command causes the browser to traverse one step forwards in the joint session history of the current top-level browsing context.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-forward).

### Usage[​](#usage-8 "Direct link to Usage")

```
await browser.forward()
```

### Example[​](#example-6 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L63-L69)

***

## refresh[​](#refresh "Direct link to refresh")

The Refresh command causes the browser to reload the page in current top-level browsing context.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-refresh).

### Usage[​](#usage-9 "Direct link to Usage")

```
await browser.refresh()
```

### Example[​](#example-7 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L73-L78)

***

## getTitle[​](#gettitle "Direct link to getTitle")

The Get Title command returns the document title of the current top-level browsing context, equivalent to calling `document.title`.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-title).

### Usage[​](#usage-10 "Direct link to Usage")

```
await browser.getTitle()
```

### Example[​](#example-8 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L82-L86)

### Returns[​](#returns-4 "Direct link to Returns")

* **\<string>** **`title`:** Returns a string which is the same as `document.title` of the current top-level browsing context.

***

## getWindowHandle[​](#getwindowhandle "Direct link to getWindowHandle")

The Get Window Handle command returns the window handle for the current top-level browsing context. It can be used as an argument to Switch To Window.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-window-handle).

### Usage[​](#usage-11 "Direct link to Usage")

```
await browser.getWindowHandle()
```

### Example[​](#example-9 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L90-L93)

### Returns[​](#returns-5 "Direct link to Returns")

* **\<string>** **`handle`:** Returns a string which is the window handle for the current top-level browsing context.

***

## closeWindow[​](#closewindow "Direct link to closeWindow")

The Close Window command closes the current top-level browsing context. Once done, if there are no more top-level browsing contexts open, the WebDriver session itself is closed.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-close-window).

### Usage[​](#usage-12 "Direct link to Usage")

```
await browser.closeWindow()
```

### Example[​](#example-10 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L97-L117)

***

## switchToWindow[​](#switchtowindow "Direct link to switchToWindow")

The Switch To Window command is used to select the current top-level browsing context for the current session, i.e. the one that will be used for processing commands.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-switch-to-window).

info

This protocol command is embedded in the following convenient method: [switchWindow](/docs/api/browser/switchWindow.md). It is recommended to use this command instead.

### Usage[​](#usage-13 "Direct link to Usage")

```
await browser.switchToWindow(handle)
```

### Parameters[​](#parameters-4 "Direct link to Parameters")

| Name     | Type     | Details                                                                                                             |
| -------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| `handle` | `string` | a string representing a window handle, should be one of the strings that was returned in a call to getWindowHandles |

### Example[​](#example-11 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L121-L130)

***

## createWindow[​](#createwindow "Direct link to createWindow")

Create a new top-level browsing context.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#new-window).

### Usage[​](#usage-14 "Direct link to Usage")

```
await browser.createWindow(type)
```

### Parameters[​](#parameters-5 "Direct link to Parameters")

| Name   | Type     | Details                                                                                                                      |
| ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `type` | `string` | Set to 'tab' if the newly created window shares an OS-level window with the current browsing context, or 'window' otherwise. |

### Example[​](#example-12 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L134-L136)

### Returns[​](#returns-6 "Direct link to Returns")

* **\<Object>** **`window`:** New window object containing 'handle' with the value of the handle and 'type' with the value of the created window type

***

## getWindowHandles[​](#getwindowhandles "Direct link to getWindowHandles")

The Get Window Handles command returns a list of window handles for every open top-level browsing context. The order in which the window handles are returned is arbitrary.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-window-handles).

### Usage[​](#usage-15 "Direct link to Usage")

```
await browser.getWindowHandles()
```

### Example[​](#example-13 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L140-L143)

### Returns[​](#returns-7 "Direct link to Returns")

* **\<String\[]>** **`handles`:** An array which is a list of window handles.

***

## printPage[​](#printpage "Direct link to printPage")

The Print Page command renders the document to a paginated PDF document. **Note:** Chrome currently only supports this in [headless mode](https://webdriver.io/docs/capabilities/#run-browser-headless), see [`crbug753118`](https://bugs.chromium.org/p/chromium/issues/detail?id=753118)).<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#print-page).

### Usage[​](#usage-16 "Direct link to Usage")

```
await browser.printPage(orientation, scale, background, width, height, top, bottom, left, right, shrinkToFit, pageRanges)
```

### Parameters[​](#parameters-6 "Direct link to Parameters")

| Name                          | Type               | Details                                            |
| ----------------------------- | ------------------ | -------------------------------------------------- |
| `orientation`<br />*optional* | `string`           | page orientation. Default: `portrait`              |
| `scale`<br />*optional*       | `number`           | page scale. Default: `1`                           |
| `background`<br />*optional*  | `boolean`          | page background. Default: `false`                  |
| `width`<br />*optional*       | `number`           | page width in cm. Default: `21.59` from page       |
| `height`<br />*optional*      | `number`           | page height in cm. Default: `27.94` from page      |
| `top`<br />*optional*         | `number`           | page margin in cm from top margin. Default: `1`    |
| `bottom`<br />*optional*      | `number`           | page margin in cm from bottom margin. Default: `1` |
| `left`<br />*optional*        | `number`           | page margin in cm from left margin. Default: `1`   |
| `right`<br />*optional*       | `number`           | page margin in cm from right margin. Default: `1`  |
| `shrinkToFit`<br />*optional* | `boolean`          | shrink pdf to fit in page. Default: `true`         |
| `pageRanges`<br />*optional*  | `string, number[]` | page ranges. Default `[]`                          |

### Example[​](#example-14 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L150-L151)

### Returns[​](#returns-8 "Direct link to Returns")

* **\<string>** **`pdf`:** The base64-encoded PDF representation of the paginated document.

***

## switchToFrame[​](#switchtoframe "Direct link to switchToFrame")

The Switch To Frame command is used to select the current top-level browsing context or a child browsing context of the current browsing context to use as the current browsing context for subsequent commands.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-switch-to-frame).

caution

This protocol command is deprecated<br />This command is deprecated and we encourage everyone to use `switchFrame` instead for switching into frames. Read more about this command at <https://webdriver.io/docs/api/browser/switchFrame>.

### Usage[​](#usage-17 "Direct link to Usage")

```
await browser.switchToFrame(id)
```

### Parameters[​](#parameters-7 "Direct link to Parameters")

| Name | Type                   | Details                                                                                                                                                                                                                                  |
| ---- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | `number, object, null` | one of three possible types: null: this represents the top-level browsing context (i.e., not an iframe), a Number, representing the index of the window object corresponding to a frame, an Element object received using `findElement`. |

### Example[​](#example-15 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L155-L168)

***

## switchToParentFrame[​](#switchtoparentframe "Direct link to switchToParentFrame")

The Switch to Parent Frame command sets the current browsing context for future commands to the parent of the current browsing context.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-switch-to-parent-frame).

### Usage[​](#usage-18 "Direct link to Usage")

```
await browser.switchToParentFrame()
```

### Example[​](#example-16 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L172-L189)

***

## getWindowRect[​](#getwindowrect "Direct link to getWindowRect")

The Get Window Rect command returns the size and position on the screen of the operating system window corresponding to the current top-level browsing context.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-window-rect).

info

This protocol command is embedded in the following convenient method: [getWindowSize](/docs/api/browser/getWindowSize.md). It is recommended to use this command instead.

### Usage[​](#usage-19 "Direct link to Usage")

```
await browser.getWindowRect()
```

### Example[​](#example-17 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L193-L196)

### Returns[​](#returns-9 "Direct link to Returns")

* **\<Object>** **`windowRect`:** A JSON representation of a "window rect" object. This has 4 properties: `x`, `y`, `width` and `height`.

***

## setWindowRect[​](#setwindowrect "Direct link to setWindowRect")

The Set Window Rect command alters the size and the position of the operating system window corresponding to the current top-level browsing context.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-set-window-rect).

info

This protocol command is embedded in the following convenient method: [setWindowSize](/docs/api/browser/setWindowSize.md). It is recommended to use this command instead.

### Usage[​](#usage-20 "Direct link to Usage")

```
await browser.setWindowRect(x, y, width, height)
```

### Parameters[​](#parameters-8 "Direct link to Parameters")

| Name     | Type           | Details                                                                                               |
| -------- | -------------- | ----------------------------------------------------------------------------------------------------- |
| `x`      | `number, null` | the screenX attribute of the window object                                                            |
| `y`      | `number, null` | the screenY attribute of the window object                                                            |
| `width`  | `number, null` | the width of the outer dimensions of the top-level browsing context, including browser chrome etc...  |
| `height` | `number, null` | the height of the outer dimensions of the top-level browsing context, including browser chrome etc... |

### Example[​](#example-18 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L200-L204)

### Returns[​](#returns-10 "Direct link to Returns")

* **\<Object>** **`windowRect`:** A JSON representation of a "window rect" object based on the new window state.

***

## maximizeWindow[​](#maximizewindow "Direct link to maximizeWindow")

The Maximize Window command invokes the window manager-specific "maximize" operation, if any, on the window containing the current top-level browsing context. This typically increases the window to the maximum available size without going full-screen.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-maximize-window).

### Usage[​](#usage-21 "Direct link to Usage")

```
await browser.maximizeWindow()
```

### Example[​](#example-19 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L208-L212)

### Returns[​](#returns-11 "Direct link to Returns")

* **\<Object>** **`windowRect`:** A JSON representation of a "window rect" object based on the new window state.

***

## minimizeWindow[​](#minimizewindow "Direct link to minimizeWindow")

The Minimize Window command invokes the window manager-specific "minimize" operation, if any, on the window containing the current top-level browsing context. This typically hides the window in the system tray.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-minimize-window).

### Usage[​](#usage-22 "Direct link to Usage")

```
await browser.minimizeWindow()
```

### Returns[​](#returns-12 "Direct link to Returns")

* **\<Object>** **`windowRect`:** A JSON representation of a "window rect" object of the (new) current top-level browsing context.

***

## fullscreenWindow[​](#fullscreenwindow "Direct link to fullscreenWindow")

The Fullscreen Window command invokes the window manager-specific “full screen” operation, if any, on the window containing the current top-level browsing context. This typically increases the window to the size of the physical display and can hide browser chrome elements such as toolbars.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-fullscreen-window).

### Usage[​](#usage-23 "Direct link to Usage")

```
await browser.fullscreenWindow()
```

### Returns[​](#returns-13 "Direct link to Returns")

* **\<Object>** **`windowRect`:** A JSON representation of a "window rect" object of the (new) current top-level browsing context.

***

## findElement[​](#findelement "Direct link to findElement")

The Find Element command is used to find an element in the current browsing context that can be used for future commands. This command returns JSON representation of the element that can be passed to $ command to transform the reference to an extended WebdriverIO element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-find-element).

info

This protocol command is embedded in the following convenient method: [$](/docs/api/browser/$.md). It is recommended to use this command instead.

### Usage[​](#usage-24 "Direct link to Usage")

```
await browser.findElement(using, value)
```

### Parameters[​](#parameters-9 "Direct link to Parameters")

| Name    | Type     | Details                                                  |
| ------- | -------- | -------------------------------------------------------- |
| `using` | `string` | a valid element location strategy                        |
| `value` | `string` | the actual selector that will be used to find an element |

### Example[​](#example-20 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L226-L232)

### Returns[​](#returns-14 "Direct link to Returns")

* **\<object>** **`element`:** A JSON representation of an element object, e.g. `{ 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT_1' }`.

***

## findElementFromShadowRoot[​](#findelementfromshadowroot "Direct link to findElementFromShadowRoot")

The Find Element From Shadow Root command is used to find an element within the shadow root of an element that can be used for future commands. This command returns JSON representation of the element that can be passed to $ command to transform the reference to an extended WebdriverIO element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#find-element-from-shadow-root).

info

This protocol command is embedded in the following convenient method: [shadow$](/docs/api/element/shadow$.md). It is recommended to use this command instead.

### Usage[​](#usage-25 "Direct link to Usage")

```
await browser.findElementFromShadowRoot(shadowId, using, value)
```

### Parameters[​](#parameters-10 "Direct link to Parameters")

| Name       | Type     | Details                                                  |
| ---------- | -------- | -------------------------------------------------------- |
| `shadowId` | `String` | element id of a shadow root element                      |
| `using`    | `string` | a valid element location strategy                        |
| `value`    | `string` | the actual selector that will be used to find an element |

### Example[​](#example-21 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L236-L248)

### Returns[​](#returns-15 "Direct link to Returns")

* **\<object>** **`element`:** A JSON representation of an element shadow object, e.g. `{ 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT_1' }`.

***

## findElements[​](#findelements "Direct link to findElements")

The Find Elements command is used to find elements in the current browsing context that can be used for future commands. This command returns array of JSON representation of the elements that can be passed to $ command to transform the reference to an extended WebdriverIO element (See findElement).<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-find-elements).

info

This protocol command is embedded in the following convenient method: [$$](/docs/api/browser/$$.md). It is recommended to use this command instead.

### Usage[​](#usage-26 "Direct link to Usage")

```
await browser.findElements(using, value)
```

### Parameters[​](#parameters-11 "Direct link to Parameters")

| Name    | Type     | Details                                                  |
| ------- | -------- | -------------------------------------------------------- |
| `using` | `string` | a valid element location strategy                        |
| `value` | `string` | the actual selector that will be used to find an element |

### Example[​](#example-22 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L252-L254)

### Returns[​](#returns-16 "Direct link to Returns")

* **\<object\[]>** **`elements`:** A (possibly empty) JSON list of representations of an element object, e.g. `[{ 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT_1' }]`.

***

## findElementsFromShadowRoot[​](#findelementsfromshadowroot "Direct link to findElementsFromShadowRoot")

The Find Elements command is used to find elements within the shadow root of an element that can be used for future commands. This command returns array of JSON representation of the elements that can be passed to $ command to transform the reference to an extended WebdriverIO element (See findElement).<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#find-elements-from-shadow-root).

info

This protocol command is embedded in the following convenient method: [shadow$$](/docs/api/element/shadow$$.md). It is recommended to use this command instead.

### Usage[​](#usage-27 "Direct link to Usage")

```
await browser.findElementsFromShadowRoot(shadowId, using, value)
```

### Parameters[​](#parameters-12 "Direct link to Parameters")

| Name       | Type     | Details                                                  |
| ---------- | -------- | -------------------------------------------------------- |
| `shadowId` | `String` | element id of a shadow root element                      |
| `using`    | `string` | a valid element location strategy                        |
| `value`    | `string` | the actual selector that will be used to find an element |

### Example[​](#example-23 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L258-L268)

### Returns[​](#returns-17 "Direct link to Returns")

* **\<object\[]>** **`elements`:** A (possibly empty) JSON list of representations of an element object, e.g. `{ 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT_1' }`.

***

## findElementFromElement[​](#findelementfromelement "Direct link to findElementFromElement")

The Find Element From Element command is used to find an element from a web element in the current browsing context that can be used for future commands. This command returns JSON representation of the element that can be passed to $ command to transform the reference to an extended WebdriverIO element (See findElement).<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-find-element-from-element).

info

This protocol command is embedded in the following convenient method: [$](/docs/api/element/$.md). It is recommended to use this command instead.

### Usage[​](#usage-28 "Direct link to Usage")

```
await browser.findElementFromElement(elementId, using, value)
```

### Parameters[​](#parameters-13 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |
| `using`     | `string` | a valid element location strategy                                   |
| `value`     | `string` | the actual selector that will be used to find an element            |

### Example[​](#example-24 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L272-L279)

### Returns[​](#returns-18 "Direct link to Returns")

* **\<object>** **`element`:** A JSON representation of an element object, e.g. `{ 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT_1' }`.

***

## findElementsFromElement[​](#findelementsfromelement "Direct link to findElementsFromElement")

The Find Elements From Element command is used to find elements from a web element in the current browsing context that can be used for future commands. This command returns array of JSON representation of the elements that can be passed to $ command to transform the reference to an extended WebdriverIO element (See findElement).<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-find-elements-from-element).

info

This protocol command is embedded in the following convenient method: [$$](/docs/api/element/$$.md). It is recommended to use this command instead.

### Usage[​](#usage-29 "Direct link to Usage")

```
await browser.findElementsFromElement(elementId, using, value)
```

### Parameters[​](#parameters-14 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |
| `using`     | `string` | a valid element location strategy                                   |
| `value`     | `string` | the actual selector that will be used to find an element            |

### Example[​](#example-25 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L283-L290)

### Returns[​](#returns-19 "Direct link to Returns")

* **\<object\[]>** **`elements`:** A (possibly empty) JSON list of representations of an element object, e.g. `[{ 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT_1' }]`.

***

## getElementShadowRoot[​](#getelementshadowroot "Direct link to getElementShadowRoot")

Get the shadow root object of an element. The result object can be used to fetch elements within this shadow root using e.g. findElementFromShadowRoots or findElementsFromShadowRoots.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#get-element-shadow-root).

info

This protocol command is embedded in the following convenient method: [shadow$](/docs/api/element/shadow$.md). It is recommended to use this command instead.

### Usage[​](#usage-30 "Direct link to Usage")

```
await browser.getElementShadowRoot(elementId)
```

### Parameters[​](#parameters-15 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-26 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L294-L305)

### Returns[​](#returns-20 "Direct link to Returns")

* **\<object>** **`shadowRoot`:** A JSON representation of an element shadow root, e.g. `{ 'shadow-6066-11e4-a52e-4f735466cecf': 'ELEMENT_1' }`.

***

## getActiveElement[​](#getactiveelement "Direct link to getActiveElement")

Get Active Element returns the active element of the current browsing context’s document element. This command returns JSON representation of the element that can be passed to $ command to transform the reference to an extended WebdriverIO element (See findElement).<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-active-element).

### Usage[​](#usage-31 "Direct link to Usage")

```
await browser.getActiveElement()
```

### Example[​](#example-27 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L309-L316)

### Returns[​](#returns-21 "Direct link to Returns")

* **\<object>** **`element`:** A JSON representation of an element object, e.g. `{ 'element-6066-11e4-a52e-4f735466cecf': 'ELEMENT_1' }`.

***

## isElementSelected[​](#iselementselected "Direct link to isElementSelected")

Is Element Selected determines if the referenced element is selected or not. This operation only makes sense on input elements of the Checkbox- and Radio Button states, or option elements.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-is-element-selected).

info

This protocol command is embedded in the following convenient method: [isSelected](/docs/api/element/isSelected.md). It is recommended to use this command instead.

### Usage[​](#usage-32 "Direct link to Usage")

```
await browser.isElementSelected(elementId)
```

### Parameters[​](#parameters-16 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-28 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L322-L325)

### Returns[​](#returns-22 "Direct link to Returns")

* **\<Boolean>** **`isSelected`:** `true` or `false` based on the selected state.

***

## isElementDisplayed[​](#iselementdisplayed "Direct link to isElementDisplayed")

Is Element Displayed determines the visibility of an element which is guided by what is perceptually visible to the human eye. In this context, an element's displayedness does not relate to the `visibility` or `display` style properties.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#element-displayedness).

info

This protocol command is embedded in the following convenient method: [isDisplayed](/docs/api/element/isDisplayed.md). It is recommended to use this command instead.

### Usage[​](#usage-33 "Direct link to Usage")

```
await browser.isElementDisplayed(elementId)
```

### Parameters[​](#parameters-17 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-29 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L331-L333)

### Returns[​](#returns-23 "Direct link to Returns")

* **\<Boolean>** **`isDisplayed`:** `true` or `false` based on the visible state.

***

## getElementAttribute[​](#getelementattribute "Direct link to getElementAttribute")

The Get Element Attribute command will return the attribute of a web element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-element-attribute).

info

This protocol command is embedded in the following convenient method: [getAttribute](/docs/api/element/getAttribute.md). It is recommended to use this command instead.

### Usage[​](#usage-34 "Direct link to Usage")

```
await browser.getElementAttribute(elementId, name)
```

### Parameters[​](#parameters-18 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |
| `name`      | `String` | name of the attribute value to retrieve                             |

### Example[​](#example-30 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L339-L341)

### Returns[​](#returns-24 "Direct link to Returns")

* **<(string|null)>** **`attribute`:** The named attribute of the element.

***

## getElementProperty[​](#getelementproperty "Direct link to getElementProperty")

The Get Element Property command will return the result of getting a property of an element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-element-property).

info

This protocol command is embedded in the following convenient method: [getProperty](/docs/api/element/getProperty.md). It is recommended to use this command instead.

### Usage[​](#usage-35 "Direct link to Usage")

```
await browser.getElementProperty(elementId, name)
```

### Parameters[​](#parameters-19 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |
| `name`      | `String` | name of the attribute property to retrieve                          |

### Example[​](#example-31 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L347-L349)

### Returns[​](#returns-25 "Direct link to Returns")

* **\<unknown>** **`property`:** The value of the named own property of the element.

***

## getElementCSSValue[​](#getelementcssvalue "Direct link to getElementCSSValue")

The Get Element CSS Value command retrieves the computed value of the given CSS property of the given web element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-element-css-value).

info

This protocol command is embedded in the following convenient method: [getCSSProperty](/docs/api/element/getCSSProperty.md). It is recommended to use this command instead.

### Usage[​](#usage-36 "Direct link to Usage")

```
await browser.getElementCSSValue(elementId, propertyName)
```

### Parameters[​](#parameters-20 "Direct link to Parameters")

| Name           | Type     | Details                                                             |
| -------------- | -------- | ------------------------------------------------------------------- |
| `elementId`    | `String` | the id of an element returned in a previous call to Find Element(s) |
| `propertyName` | `String` | name of the CSS property to retrieve                                |

### Example[​](#example-32 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L355-L357)

### Returns[​](#returns-26 "Direct link to Returns")

* **\<string>** **`cssValue`:** The computed value of the parameter corresponding to property name from the element's style declarations (unless the document type is xml, in which case the return value is simply the empty string).

***

## getElementText[​](#getelementtext "Direct link to getElementText")

The Get Element Text command intends to return an element’s text "as rendered". An element's rendered text is also used for locating a elements by their link text and partial link text.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-element-text).

### Usage[​](#usage-37 "Direct link to Usage")

```
await browser.getElementText(elementId)
```

### Parameters[​](#parameters-21 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-33 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L363-L365)

### Returns[​](#returns-27 "Direct link to Returns")

* **\<string>** **`text`:** The visible text of the element (including child elements), following the algorithm defined in the Selenium Atoms for [`bot.dom.getVisibleText`](https://github.com/SeleniumHQ/selenium/blob/e09e28f016c9f53196cf68d6f71991c5af4a35d4/javascript/atoms/dom.js#L981).

***

## getElementTagName[​](#getelementtagname "Direct link to getElementTagName")

The Get Element Tag Name command returns the qualified element name of the given web element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-element-tag-name).

info

This protocol command is embedded in the following convenient method: [getTagName](/docs/api/element/getTagName.md). It is recommended to use this command instead.

### Usage[​](#usage-38 "Direct link to Usage")

```
await browser.getElementTagName(elementId)
```

### Parameters[​](#parameters-22 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-34 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L371-L373)

### Returns[​](#returns-28 "Direct link to Returns")

* **\<string>** **`text`:** The tagName attribute of the element.

***

## getElementRect[​](#getelementrect "Direct link to getElementRect")

The Get Element Rect command returns the dimensions and coordinates of the given web element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-element-rect).

info

This protocol command is embedded in the following convenient methods: [getSize](/docs/api/element/getSize.md), [getLocation](/docs/api/element/getLocation.md). It is recommended to use these commands instead.

### Usage[​](#usage-39 "Direct link to Usage")

```
await browser.getElementRect(elementId)
```

### Parameters[​](#parameters-23 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-35 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L379-L381)

### Returns[​](#returns-29 "Direct link to Returns")

* **\<Object>** **`elementRect`:** A JSON object representing the position and bounding rect of the element.

***

## isElementEnabled[​](#iselementenabled "Direct link to isElementEnabled")

Is Element Enabled determines if the referenced element is enabled or not. This operation only makes sense on form controls.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-is-element-enabled).

info

This protocol command is embedded in the following convenient method: [isEnabled](/docs/api/element/isEnabled.md). It is recommended to use this command instead.

### Usage[​](#usage-40 "Direct link to Usage")

```
await browser.isElementEnabled(elementId)
```

### Parameters[​](#parameters-24 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-36 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L387-L390)

### Returns[​](#returns-30 "Direct link to Returns")

* **\<Boolean>** **`isEnabled`:** If the element is in an xml document, or is a disabled form control: `false`, otherwise, `true`.

***

## elementClick[​](#elementclick "Direct link to elementClick")

The Element Click command scrolls into view the element if it is not already pointer-interactable, and clicks its in-view center point. If the element's center point is obscured by another element, an element click intercepted error is returned. If the element is outside the viewport, an element not interactable error is returned.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-element-click).

info

This protocol command is embedded in the following convenient method: [click](/docs/api/element/click.md). It is recommended to use this command instead.

### Usage[​](#usage-41 "Direct link to Usage")

```
await browser.elementClick(elementId)
```

### Parameters[​](#parameters-25 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-37 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L396-L398)

***

## elementClear[​](#elementclear "Direct link to elementClear")

The Element Clear command scrolls into view an editable or resettable element and then attempts to clear its selected files or text content.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-element-clear).

info

This protocol command is embedded in the following convenient method: [clearValue](/docs/api/element/clearValue.md). It is recommended to use this command instead.

### Usage[​](#usage-42 "Direct link to Usage")

```
await browser.elementClear(elementId)
```

### Parameters[​](#parameters-26 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Example[​](#example-38 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L404-L407)

***

## elementSendKeys[​](#elementsendkeys "Direct link to elementSendKeys")

The Element Send Keys command scrolls into view the form control element and then sends the provided keys to the element. In case the element is not keyboard-interactable, an element not interactable error is returned.<br /><br />The key input state used for input may be cleared mid-way through "typing" by sending the null key, which is U+E000 (NULL).<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-element-send-keys).

info

This protocol command is embedded in the following convenient methods: [addValue](/docs/api/element/addValue.md), [setValue](/docs/api/element/setValue.md). It is recommended to use these commands instead.

### Usage[​](#usage-43 "Direct link to Usage")

```
await browser.elementSendKeys(elementId, text)
```

### Parameters[​](#parameters-27 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |
| `text`      | `string` | string to send as keystrokes to the element                         |

### Example[​](#example-39 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L413-L416)

***

## getPageSource[​](#getpagesource "Direct link to getPageSource")

The Get Page Source command returns a string serialization of the DOM of the current browsing context active document.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-page-source).

### Usage[​](#usage-44 "Direct link to Usage")

```
await browser.getPageSource()
```

### Example[​](#example-40 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L420-L421)

### Returns[​](#returns-31 "Direct link to Returns")

* **\<string>** **`pageSource`:** the DOM of the current browsing context active document

***

## executeScript[​](#executescript "Direct link to executeScript")

The Execute Script command executes a JavaScript function in the context of the current browsing context and returns the return value of the function.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-execute-script).

info

This protocol command is embedded in the following convenient method: [execute](/docs/api/browser/execute.md). It is recommended to use this command instead.

### Usage[​](#usage-45 "Direct link to Usage")

```
await browser.executeScript(script, args)
```

### Parameters[​](#parameters-28 "Direct link to Parameters")

| Name     | Type                                                 | Details                                                                                     |
| -------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `script` | `string`                                             | a string, the Javascript function body you want executed                                    |
| `args`   | `string, object, number, boolean, null, undefined[]` | an array of JSON values which will be deserialized and passed as arguments to your function |

### Example[​](#example-41 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L425-L426)

### Returns[​](#returns-32 "Direct link to Returns")

* **<\*>** **`result`:** Either the return value of your script, the fulfillment of the Promise returned by your script, or the error which was the reason for your script's returned Promise's rejection.

***

## executeAsyncScript[​](#executeasyncscript "Direct link to executeAsyncScript")

The Execute Async Script command causes JavaScript to execute as an anonymous function. Unlike the Execute Script command, the result of the function is ignored. Instead an additional argument is provided as the final argument to the function. This is a function that, when called, returns its first argument as the response.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-execute-async-script).

info

This protocol command is embedded in the following convenient method: [executeAsync](/docs/api/browser/executeAsync.md). It is recommended to use this command instead.

### Usage[​](#usage-46 "Direct link to Usage")

```
await browser.executeAsyncScript(script, args)
```

### Parameters[​](#parameters-29 "Direct link to Parameters")

| Name     | Type                                                 | Details                                                                                     |
| -------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `script` | `string`                                             | a string, the Javascript function body you want executed                                    |
| `args`   | `string, object, number, boolean, null, undefined[]` | an array of JSON values which will be deserialized and passed as arguments to your function |

### Example[​](#example-42 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L430-L434)

### Returns[​](#returns-33 "Direct link to Returns")

* **<\*>** **`result`:** Either the return value of your script, the fulfillment of the Promise returned by your script, or the error which was the reason for your script's returned Promise's rejection.

***

## getAllCookies[​](#getallcookies "Direct link to getAllCookies")

The Get All Cookies command returns all cookies associated with the address of the current browsing context’s active document.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-all-cookies).

### Usage[​](#usage-47 "Direct link to Usage")

```
await browser.getAllCookies()
```

### Example[​](#example-43 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L438-L455)

### Returns[​](#returns-34 "Direct link to Returns")

* **\<Object\[]>** **`cookies`:** A list of serialized cookies. Each serialized cookie has a number of optional fields which may or may not be returned in addition to `name` and `value`.

***

## addCookie[​](#addcookie "Direct link to addCookie")

The Add Cookie command adds a single cookie to the cookie store associated with the active document's address.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-adding-a-cookie).

### Usage[​](#usage-48 "Direct link to Usage")

```
await browser.addCookie(cookie)
```

### Parameters[​](#parameters-30 "Direct link to Parameters")

| Name     | Type     | Details                                                                                                                                   |
| -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `cookie` | `object` | A JSON object representing a cookie. It must have at least the name and value fields and could have more, including expiry-time and so on |

### Example[​](#example-44 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L459-L477)

***

## deleteAllCookies[​](#deleteallcookies "Direct link to deleteAllCookies")

The Delete All Cookies command allows deletion of all cookies associated with the active document's address.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-delete-all-cookies).

### Usage[​](#usage-49 "Direct link to Usage")

```
await browser.deleteAllCookies()
```

### Example[​](#example-45 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L481-L485)

***

## getNamedCookie[​](#getnamedcookie "Direct link to getNamedCookie")

The Get Named Cookie command returns the cookie with the requested name from the associated cookies in the cookie store of the current browsing context's active document. If no cookie is found, a no such cookie error is returned.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-named-cookie).

### Usage[​](#usage-50 "Direct link to Usage")

```
await browser.getNamedCookie(name)
```

### Parameters[​](#parameters-31 "Direct link to Parameters")

| Name   | Type     | Details                        |
| ------ | -------- | ------------------------------ |
| `name` | `String` | name of the cookie to retrieve |

### Example[​](#example-46 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L489-L503)

### Returns[​](#returns-35 "Direct link to Returns")

* **\<Object>** **`cookie`:** A serialized cookie, with name and value fields. There are a number of optional fields like `path`, `domain`, and `expiry-time` which may also be present.

***

## deleteCookie[​](#deletecookie "Direct link to deleteCookie")

The Delete Cookie command allows you to delete either a single cookie by parameter name, or all the cookies associated with the active document's address if name is undefined.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-delete-cookie).

### Usage[​](#usage-51 "Direct link to Usage")

```
await browser.deleteCookie(name)
```

### Parameters[​](#parameters-32 "Direct link to Parameters")

| Name   | Type     | Details                      |
| ------ | -------- | ---------------------------- |
| `name` | `String` | name of the cookie to delete |

### Example[​](#example-47 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L507-L512)

***

## performActions[​](#performactions "Direct link to performActions")

The Perform Actions command is used to execute complex user actions. Most users should prefer the higher-level [`browser.action()`](https://webdriver.io/docs/api/browser/action) API. See [spec](https://github.com/jlipps/simple-wd-spec#perform-actions) for more details.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-perform-actions).

### Usage[​](#usage-52 "Direct link to Usage")

```
await browser.performActions(actions)
```

### Parameters[​](#parameters-33 "Direct link to Parameters")

| Name      | Type       | Details                                                                                |
| --------- | ---------- | -------------------------------------------------------------------------------------- |
| `actions` | `object[]` | a list of objects, each of which represents an input source and its associated actions |

***

## releaseActions[​](#releaseactions "Direct link to releaseActions")

The Release Actions command is used to release all the keys and pointer buttons that are currently depressed. This causes events to be fired as if the state was released by an explicit series of actions. It also clears all the internal state of the virtual devices.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-release-actions).

### Usage[​](#usage-53 "Direct link to Usage")

```
await browser.releaseActions()
```

***

## dismissAlert[​](#dismissalert "Direct link to dismissAlert")

The Dismiss Alert command dismisses a simple dialog if present, otherwise error. A request to dismiss an alert user prompt, which may not necessarily have a dismiss button, has the same effect as accepting it.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-dismiss-alert).

### Usage[​](#usage-54 "Direct link to Usage")

```
await browser.dismissAlert()
```

### Example[​](#example-48 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L516-L517)

***

## acceptAlert[​](#acceptalert "Direct link to acceptAlert")

The Accept Alert command accepts a simple dialog if present, otherwise error.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-accept-alert).

### Usage[​](#usage-55 "Direct link to Usage")

```
await browser.acceptAlert()
```

***

## getAlertText[​](#getalerttext "Direct link to getAlertText")

The Get Alert Text command returns the message of the current user prompt. If there is no current user prompt, it returns an error.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-get-alert-text).

### Usage[​](#usage-56 "Direct link to Usage")

```
await browser.getAlertText()
```

### Example[​](#example-49 "Direct link to Example")

examples.js

```
loading...
```

[View on GitHub](https://github.com/webdriverio/example-recipes/blob/e8b147e88e7a38351b0918b4f7efbd9ae292201d/api/webdriver/examples.js#L521-L522)

### Returns[​](#returns-36 "Direct link to Returns")

* **\<string>** **`alertText`:** The message of the user prompt.

***

## sendAlertText[​](#sendalerttext "Direct link to sendAlertText")

The Send Alert Text command sets the text field of a window\.prompt user prompt to the given value.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-send-alert-text).

### Usage[​](#usage-57 "Direct link to Usage")

```
await browser.sendAlertText(text)
```

### Parameters[​](#parameters-34 "Direct link to Parameters")

| Name   | Type     | Details                     |
| ------ | -------- | --------------------------- |
| `text` | `string` | string to set the prompt to |

***

## takeScreenshot[​](#takescreenshot "Direct link to takeScreenshot")

The Take Screenshot command takes a screenshot of the top-level browsing context's viewport.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-take-screenshot).

### Usage[​](#usage-58 "Direct link to Usage")

```
await browser.takeScreenshot()
```

### Returns[​](#returns-37 "Direct link to Returns")

* **\<string>** **`screenshot`:** The base64-encoded PNG image data comprising the screenshot of the initial viewport.

***

## takeElementScreenshot[​](#takeelementscreenshot "Direct link to takeElementScreenshot")

The Take Element Screenshot command takes a screenshot of the visible region encompassed by the bounding rectangle of an element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#dfn-take-element-screenshot).

### Usage[​](#usage-59 "Direct link to Usage")

```
await browser.takeElementScreenshot(elementId)
```

### Parameters[​](#parameters-35 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Returns[​](#returns-38 "Direct link to Returns")

* **\<string>** **`screenshot`:** The base64-encoded PNG image data comprising the screenshot of the visible region of an element’s bounding rectangle after it has been scrolled into view.

***

## getElementComputedRole[​](#getelementcomputedrole "Direct link to getElementComputedRole")

Get the computed WAI-ARIA role of an element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#get-computed-role).

### Usage[​](#usage-60 "Direct link to Usage")

```
await browser.getElementComputedRole(elementId)
```

### Parameters[​](#parameters-36 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Returns[​](#returns-39 "Direct link to Returns")

* **\<string>** **`role`:** The result of computing the WAI-ARIA role of element.

***

## getElementComputedLabel[​](#getelementcomputedlabel "Direct link to getElementComputedLabel")

Get the accessible name of the element.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver/#get-computed-label).

### Usage[​](#usage-61 "Direct link to Usage")

```
await browser.getElementComputedLabel(elementId)
```

### Parameters[​](#parameters-37 "Direct link to Parameters")

| Name        | Type     | Details                                                             |
| ----------- | -------- | ------------------------------------------------------------------- |
| `elementId` | `String` | the id of an element returned in a previous call to Find Element(s) |

### Returns[​](#returns-40 "Direct link to Returns")

* **\<string>** **`label`:** The result of a Accessible Name and Description Computation for the Accessible Name of the element.

***

## setPermissions[​](#setpermissions "Direct link to setPermissions")

Simulates user modification of a PermissionDescriptor's permission state. **Note:** this feature has not landed in all browsers yet.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/permissions/#set-permission-command).

### Usage[​](#usage-62 "Direct link to Usage")

```
await browser.setPermissions(descriptor, state, oneRealm)
```

### Parameters[​](#parameters-38 "Direct link to Parameters")

| Name                       | Type      | Details                                                                                                                                                                                                                                                                          |
| -------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `descriptor`               | `object`  | Each powerful feature has one or more aspects that websites can request permission to access. To describe these aspects, each feature defines a subtype of PermissionDescriptor to be its permission descriptor type. **Note:** this feature has not landed in all browsers yet. |
| `state`                    | `string`  | Determines whether permission is granted, denied or prompted.                                                                                                                                                                                                                    |
| `oneRealm`<br />*optional* | `boolean` | Whether or not to apply permissions to all execution contexts.                                                                                                                                                                                                                   |

### Examples[​](#examples "Direct link to Examples")

```
// set midi permissions
browser.setPermissions(
  { name: 'midi', sysex: true },
  'granted' // can be also "denied" or "prompt"
);
```

```
// set clipboard permissions
browser.setPermissions({ name: 'clipboard-read' }, 'granted');
// now you can read the clipboard via, e.g.
const clipboardText = await browser.execute(() => navigator.clipboard.readText());
```

***

## generateTestReport[​](#generatetestreport "Direct link to generateTestReport")

Generates a report for testing. Extension for [Reporting API](https://developers.google.com/web/updates/2018/09/reportingapi). **Note:** this feature has not landed in all browsers yet.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/reporting/#automation).

### Usage[​](#usage-63 "Direct link to Usage")

```
await browser.generateTestReport(message, group)
```

### Parameters[​](#parameters-39 "Direct link to Parameters")

| Name                    | Type     | Details                                                |
| ----------------------- | -------- | ------------------------------------------------------ |
| `message`               | `string` | Message to be displayed in the report.                 |
| `group`<br />*optional* | `string` | Specifies the endpoint group to deliver the report to. |

***

## createMockSensor[​](#createmocksensor "Direct link to createMockSensor")

Creates a mock sensor to emulate sensors like Ambient Light Sensor. **Note:** this feature has not landed in all browsers yet.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/sensors/#create-mock-sensor-command).

### Usage[​](#usage-64 "Direct link to Usage")

```
await browser.createMockSensor(type, connected, maxSamplingFrequency, minSamplingFrequency)
```

### Parameters[​](#parameters-40 "Direct link to Parameters")

| Name                                   | Type      | Details                                                                                                                        |
| -------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `type`                                 | `string`  | Type of sensor API to mock, e.g. 'ambient-light'                                                                               |
| `connected`<br />*optional*            | `boolean` | A flag indicating whether the mock sensor is connected.                                                                        |
| `maxSamplingFrequency`<br />*optional* | `number`  | A double representing frequency in Hz that is used to set maximum supported sampling frequency for the associated mock sensor. |
| `minSamplingFrequency`<br />*optional* | `number`  | A double representing frequency in Hz that is used to set minimum supported sampling frequency for the associated mock sensor. |

***

## getMockSensor[​](#getmocksensor "Direct link to getMockSensor")

Retrieves information about a given type of mock sensor. **Note:** this feature has not landed in all browsers yet.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/sensors/#get-mock-sensor-command).

### Usage[​](#usage-65 "Direct link to Usage")

```
await browser.getMockSensor(type)
```

### Parameters[​](#parameters-41 "Direct link to Parameters")

| Name   | Type     | Details                                        |
| ------ | -------- | ---------------------------------------------- |
| `type` | `String` | Mock sensor type to retrieve information from. |

### Returns[​](#returns-41 "Direct link to Returns")

* **\<object>** **`sensorReading`:** Values of the mock sensor reading.

***

## updateMockSensor[​](#updatemocksensor "Direct link to updateMockSensor")

Updates the mock sensor type. **Note:** this feature has not landed in all browsers yet.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/sensors/#update-mock-sensor-reading-command).

### Usage[​](#usage-66 "Direct link to Usage")

```
await browser.updateMockSensor(type, reading)
```

### Parameters[​](#parameters-42 "Direct link to Parameters")

| Name      | Type     | Details                                     |
| --------- | -------- | ------------------------------------------- |
| `type`    | `String` | Mock sensor type to update information for. |
| `reading` | `object` | A JSON Object with the new reading.         |

***

## deleteMockSensor[​](#deletemocksensor "Direct link to deleteMockSensor")

The Delete Session command closes any top-level browsing contexts associated with the current session, terminates the connection, and finally closes the current session. **Note:** this feature has not landed in all browsers yet.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/sensors/#delete-mock-sensor-command).

### Usage[​](#usage-67 "Direct link to Usage")

```
await browser.deleteMockSensor(type)
```

### Parameters[​](#parameters-43 "Direct link to Parameters")

| Name   | Type     | Details                     |
| ------ | -------- | --------------------------- |
| `type` | `String` | Mock sensor type to delete. |

***

## setTimeZone[​](#settimezone "Direct link to setTimeZone")

Simulates the changing of a time zone for the purposes of testing. **Note:** this feature has not landed in all browsers yet.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://w3c.github.io/webdriver-bidi/#command-emulation-setTimezoneOverride).

### Usage[​](#usage-68 "Direct link to Usage")

```
await browser.setTimeZone(time_zone)
```

### Parameters[​](#parameters-44 "Direct link to Parameters")

| Name        | Type     | Details                               |
| ----------- | -------- | ------------------------------------- |
| `time_zone` | `string` | Name of the timezone, e.g. Asia/Tokyo |

***

## addVirtualAuthenticator[​](#addvirtualauthenticator "Direct link to addVirtualAuthenticator")

Creates a software [Virtual Authenticator](https://www.w3.org/TR/webauthn-2/#virtual-authenticators).<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://www.w3.org/TR/webauthn-2/#sctn-automation-add-virtual-authenticator).

### Usage[​](#usage-69 "Direct link to Usage")

```
await browser.addVirtualAuthenticator(protocol, transport, hasResidentKey, hasUserVerification, isUserConsenting, isUserVerified, extensions, uvm)
```

### Parameters[​](#parameters-45 "Direct link to Parameters")

| Name                                  | Type       | Details                                                 |
| ------------------------------------- | ---------- | ------------------------------------------------------- |
| `protocol`                            | `string`   | Valid values: 'ctap1/u2f', 'ctap2', 'ctap2\_1'.         |
| `transport`                           | `string`   | Valid values: 'usb', 'nfc', 'ble' or 'internal'.        |
| `hasResidentKey`<br />*optional*      | `boolean`  | Valid values: true, false.                              |
| `hasUserVerification`<br />*optional* | `boolean`  | Valid values: true, false.                              |
| `isUserConsenting`<br />*optional*    | `boolean`  | Valid values: true, false.                              |
| `isUserVerified`<br />*optional*      | `boolean`  | Valid values: true, false.                              |
| `extensions`<br />*optional*          | `string[]` | An array of extension identifiers                       |
| `uvm`<br />*optional*                 | `object[]` | Valid values: Up to 3 User Verification Method entries. |

### Returns[​](#returns-42 "Direct link to Returns")

* **\<string>** **`authenticatorId`:** Returns the string ID of the authenticator.

***

## removeVirtualAuthenticator[​](#removevirtualauthenticator "Direct link to removeVirtualAuthenticator")

Removes a previously created Virtual Authenticator.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-virtual-authenticator).

### Usage[​](#usage-70 "Direct link to Usage")

```
await browser.removeVirtualAuthenticator(authenticatorId)
```

### Parameters[​](#parameters-46 "Direct link to Parameters")

| Name              | Type     | Details             |
| ----------------- | -------- | ------------------- |
| `authenticatorId` | `String` | id of authenticator |

***

## addCredential[​](#addcredential "Direct link to addCredential")

Injects a Public Key Credential Source into an existing Virtual Authenticator.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://www.w3.org/TR/webauthn-2/#sctn-automation-add-credential).

### Usage[​](#usage-71 "Direct link to Usage")

```
await browser.addCredential(authenticatorId, credentialId, isResidentCredential, rpId, privateKey, userHandle, signCount, largeBlob)
```

### Parameters[​](#parameters-47 "Direct link to Parameters")

| Name                         | Type           | Details                                                                                                                                            |
| ---------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `authenticatorId`            | `String`       | ID of authenticator                                                                                                                                |
| `credentialId`               | `string`       | The Credential ID encoded using Base64url Encoding.                                                                                                |
| `isResidentCredential`       | `boolean`      | If set to true, a client-side discoverable credential is created. If set to false, a server-side credential is created instead.                    |
| `rpId`                       | `string`       | The Relying Party ID the credential is scoped to.                                                                                                  |
| `privateKey`                 | `string`       | An asymmetric key package containing a single private key per \[RFC5958], encoded using Base64url Encoding.                                        |
| `userHandle`<br />*optional* | `string`       | The userHandle associated to the credential encoded using Base64url Encoding. This property may not be defined.                                    |
| `signCount`<br />*optional*  | `number, null` | The initial value for a signature counter associated to the public key credential source.                                                          |
| `largeBlob`<br />*optional*  | `string`       | The large, per-credential blob associated to the public key credential source, encoded using Base64url Encoding. This property may not be defined. |

***

## getCredentials[​](#getcredentials "Direct link to getCredentials")

Returns one Credential Parameters object for every Public Key Credential Source stored in a Virtual Authenticator, regardless of whether they were stored using Add Credential or `navigator.credentials.create()`.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://www.w3.org/TR/webauthn-2/#sctn-automation-get-credentials).

### Usage[​](#usage-72 "Direct link to Usage")

```
await browser.getCredentials(authenticatorId)
```

### Parameters[​](#parameters-48 "Direct link to Parameters")

| Name              | Type     | Details             |
| ----------------- | -------- | ------------------- |
| `authenticatorId` | `String` | id of authenticator |

### Returns[​](#returns-43 "Direct link to Returns")

* **\<object\[]>** **`credentials`:** Returns an array of credentials.

***

## removeAllCredentials[​](#removeallcredentials "Direct link to removeAllCredentials")

Removes all Public Key Credential Sources stored on a Virtual Authenticator.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-all-credentials).

### Usage[​](#usage-73 "Direct link to Usage")

```
await browser.removeAllCredentials(authenticatorId)
```

### Parameters[​](#parameters-49 "Direct link to Parameters")

| Name              | Type     | Details             |
| ----------------- | -------- | ------------------- |
| `authenticatorId` | `String` | id of authenticator |

***

## removeCredential[​](#removecredential "Direct link to removeCredential")

Removes a Public Key Credential Source stored on a Virtual Authenticator.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-credential).

### Usage[​](#usage-74 "Direct link to Usage")

```
await browser.removeCredential(authenticatorId, credentialId)
```

### Parameters[​](#parameters-50 "Direct link to Parameters")

| Name              | Type     | Details             |
| ----------------- | -------- | ------------------- |
| `authenticatorId` | `String` | id of authenticator |
| `credentialId`    | `String` | id of credential    |

***

## setUserVerified[​](#setuserverified "Direct link to setUserVerified")

The Set User Verified extension command sets the isUserVerified property on the Virtual Authenticator.<br /><br />WebDriver Protocol command. More details can be found in the [official protocol docs](https://www.w3.org/TR/webauthn-2/#sctn-automation-set-user-verified).

### Usage[​](#usage-75 "Direct link to Usage")

```
await browser.setUserVerified(authenticatorId, isUserVerified)
```

### Parameters[​](#parameters-51 "Direct link to Parameters")

| Name              | Type      | Details                                        |
| ----------------- | --------- | ---------------------------------------------- |
| `authenticatorId` | `String`  | id of authenticator                            |
| `isUserVerified`  | `boolean` | Whether to always succeed in user verification |
