Action reference¶
Actions run against a Locator. Get one from $page.locator($selector), then
call an action on it. Playwright auto-waits for the element to be actionable
before each action.
1 2 | |
click¶
Clicks the element.
1 | |
fill¶
Sets the value of an input, replacing any existing value.
1 | |
type¶
Types text one key at a time, appending to the current value. Use fill to
replace; use type when per-keystroke events matter.
1 | |
press¶
Dispatches a single key.
1 | |
check and uncheck¶
Tick or clear a checkbox.
1 2 | |
select-option¶
Selects an option in a <select> by value and returns the chosen values.
1 | |
hover¶
Moves the pointer over the element.
1 | |