Skip to main content
Page actions methods for the Playwright driver.

click

Click on an element matching the selector.
Deprecated: Use locator.click() instead.
Upstream docs
selector
string
required
options
PlaywrightClickOptions
await page.click('...');

dblclick

Double-click on an element matching the selector.
Deprecated: Use locator.dblclick() instead.
Upstream docs
selector
string
required
options
PlaywrightDblclickOptions
await page.dblclick('...');

fill

Fill an input element with the given value.
Deprecated: Use locator.fill() instead.
Upstream docs
selector
string
required
value
string
required
options
PlaywrightFillOptions
await page.fill('...', '...');

type

Type text into an element (sends keydown, keypress/input, keyup events for each character).
Deprecated: Use locator.pressSequentially() instead.
Upstream docs
selector
string
required
text
string
required
options
PlaywrightTypeOptions
await page.type('...', '...');

press

Focus an element and press a key combination.
Deprecated: Use locator.press() instead.
Upstream docs
selector
string
required
key
string
required
options
PlaywrightPressOptions
await page.press('...', '...');

hover

Hover over an element.
Deprecated: Use locator.hover() instead.
Upstream docs
selector
string
required
options
PlaywrightHoverOptions
await page.hover('...');

focus

Focus on an element.
Deprecated: Use locator.focus() instead.
Upstream docs
selector
string
required
options
PlaywrightFocusOptions
await page.focus('...');

tap

Tap on an element (for touch devices).
Deprecated: Use locator.tap() instead.
Upstream docs
selector
string
required
options
PlaywrightTapOptions
await page.tap('...');

check

Check a checkbox or radio button.
Deprecated: Use locator.check() instead.
Upstream docs
selector
string
required
options
PlaywrightCheckOptions
await page.check('...');

uncheck

Uncheck a checkbox.
Deprecated: Use locator.uncheck() instead.
Upstream docs
selector
string
required
options
PlaywrightCheckOptions
await page.uncheck('...');

setChecked

Set the checked state of a checkbox.
Deprecated: Use locator.setChecked() instead.
Upstream docs
selector
string
required
checked
boolean
required
options
PlaywrightSetCheckedOptions
await page.setChecked('...', true);

selectOption

Select one or more options in a <select> element.
Deprecated: Use locator.selectOption() instead.
Upstream docs
selector
string
required
values
string | SelectOption | (string | SelectOption)[]
required
options
PlaywrightSelectOptionOptions
result
string[]
Return value
await page.selectOption('...', /* string | SelectOption | (string | SelectOption)[] */);

setInputFiles

Set input files for a file input element.
Deprecated: Use locator.setInputFiles() instead.
Upstream docs
selector
string
required
files
string | string[] | FilePayload | FilePayload[]
required
options
PlaywrightSetInputFilesOptions
await page.setInputFiles('...', /* string | string[] | FilePayload | FilePayload[] */);

dispatchEvent

Dispatch a DOM event on an element.
Deprecated: Use locator.dispatchEvent() instead.
Upstream docs
selector
string
required
type
string
required
eventInit
Record<string, unknown>
options
PlaywrightDispatchEventOptions
await page.dispatchEvent('...', '...');

dragAndDrop

Drag an element to another element. Upstream docs
source
string
required
target
string
required
options
PlaywrightDragAndDropOptions
await page.dragAndDrop('...', '...');