***
title: Playwright Locator
description: Complete Locator method reference for the Playwright driver.
-------------------------------------------------------------------------
All `Locator` methods available when using the **Playwright** driver.
Access via `runtime.page.locator(...)` after launching a Playwright runtime.
Every method below is a remote call. The SDK translates it into a structured step sent to a single endpoint:
```
POST /v1/workspaces/{workspaceId}/execute
```
```json
{
"runtime": "my-browser",
"steps": [
{
"call": "locator.goto",
"args": ["https://example.com"]
}
]
}
```
The `call` field maps directly to the method name. `args` is a JSON array of the method's arguments. You can batch multiple steps in one request.
## Actions
### click(options?)
Clicks on the element.
Waits for actionability checks, scrolls element into view,
and uses Page.mouse to click in the center of the element.
```ts
await locator.click();
```
| Parameter | Type | Required | Description |
| --------- | ------------------------ | -------- | ----------- |
| `options` | `PlaywrightClickOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-click)
***
### dblclick(options?)
Double-clicks on the element.
Performs two clicks with a short delay, simulating a native double-click.
Waits for actionability checks before performing the action.
```ts
await runtime.page.locator(...).dblclick();
```
| Parameter | Type | Required | Description |
| --------- | --------------------------- | -------- | ----------- |
| `options` | `PlaywrightDblclickOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-dblclick)
***
### fill(value, options?)
Fills an input or textarea element with the specified value.
This method waits for actionability checks, focuses the element,
fills it, and triggers an input event. It clears the existing value before filling.
Works with \, \
```ts
await page.getByLabel('Password').fill('secret');
```
| Parameter | Type | Required | Description |
| --------- | ----------------------- | -------- | ---------------- |
| `value` | `string` | Yes | Value to fill in |
| `options` | `PlaywrightFillOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-fill)
***
### clear(options?)
Clears the input field.
Waits for actionability checks, focuses the element,
clears it, and triggers an input event.
```ts
await runtime.page.locator(...).clear();
```
| Parameter | Type | Required | Description |
| --------- | ------------------------ | -------- | ----------- |
| `options` | `PlaywrightClearOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-clear)
***
### press(key, options?)
Presses a single key or key combination.
Focuses the element, then uses keyboard.down() and keyboard.up().
Supports modifier keys like Control, Shift, Alt, Meta.
```ts
await locator.press('Enter');
```
| Parameter | Type | Required | Description |
| --------- | ------------------------ | -------- | ----------------------------------------- |
| `key` | `string` | Yes | Key to press (e.g., "Enter", "Control+A") |
| `options` | `PlaywrightPressOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-press)
***
### pressSequentially(text, options?)
Types text character by character with keydown, keypress, and keyup events.
Use this for special keyboard handling. In most cases, fill() is preferred.
The delay option can simulate realistic typing speed.
```ts
await locator.pressSequentially('Hello');
```
| Parameter | Type | Required | Description |
| --------- | ------------------------------------ | -------- | ------------------ |
| `text` | `string` | Yes | Characters to type |
| `options` | `PlaywrightPressSequentiallyOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-press-sequentially)
***
### type(text, options?)
Types text into the element (DEPRECATED - use fill() or pressSequentially()).
This method is deprecated. Use fill() for most cases,
or pressSequentially() when special keyboard handling is required.
```ts
await runtime.page.locator(...).type('...');
```
| Parameter | Type | Required | Description |
| --------- | ------------------------------------------------------------- | -------- | ----------- |
| `text` | `string` | Yes | — |
| `options` | `{ delay?: number; noWaitAfter?: boolean; timeout?: number }` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-type)
***
### hover(options?)
Hovers over the element.
Waits for actionability checks, scrolls element into view,
and moves mouse to the center of the element.
```ts
await runtime.page.locator(...).hover();
```
| Parameter | Type | Required | Description |
| --------- | ------------------------ | -------- | ----------- |
| `options` | `PlaywrightHoverOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-hover)
***
### tap(options?)
Performs a tap gesture on the element.
Requires hasTouch option to be enabled in browser context.
Waits for actionability checks before performing the tap.
```ts
await runtime.page.locator(...).tap();
```
| Parameter | Type | Required | Description |
| --------- | ---------------------- | -------- | ----------- |
| `options` | `PlaywrightTapOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-tap)
***
### focus(options?)
Focuses the element.
```ts
await runtime.page.locator(...).focus();
```
| Parameter | Type | Required | Description |
| --------- | ------------------------ | -------- | ----------- |
| `options` | `PlaywrightFocusOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-focus)
***
### blur(options?)
Removes focus from the element.
```ts
await runtime.page.locator(...).blur();
```
| Parameter | Type | Required | Description |
| --------- | ----------------------- | -------- | ----------- |
| `options` | `PlaywrightBlurOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-blur)
***
### check(options?)
Checks a checkbox or radio button.
If already checked, this method does nothing.
```ts
await runtime.page.locator(...).check();
```
| Parameter | Type | Required | Description |
| --------- | ------------------------ | -------- | ----------- |
| `options` | `PlaywrightCheckOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-check)
***
### uncheck(options?)
Unchecks a checkbox.
If already unchecked, this method does nothing.
```ts
await runtime.page.locator(...).uncheck();
```
| Parameter | Type | Required | Description |
| --------- | -------------------------- | -------- | ----------- |
| `options` | `PlaywrightUncheckOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-uncheck)
***
### setChecked(checked, options?)
Sets the checked state of a checkbox or radio button.
```ts
await runtime.page.locator(...).setChecked(true);
```
| Parameter | Type | Required | Description |
| --------- | ----------------------------- | -------- | --------------------------- |
| `checked` | `boolean` | Yes | Whether to check or uncheck |
| `options` | `PlaywrightSetCheckedOptions` | No | — |
[Upstream docs](https://playwright.dev/docs/api/class-locator#locator-set-checked)
***
### selectOption(values, options?)
Selects option(s) in a \