click
Click the element.This method clicks the element by performing actionability checks, scrolling into view, and simulating a mouse click. Discouraged in favor of locator.click().
dblclick
Double-click the element.Discouraged in favor of locator.dblclick().
fill
Fill an input, textarea, or contenteditable element with the specified value.This method waits for actionability checks, focuses the element, fills it, and triggers an input event. Pass empty string to clear. Discouraged in favor of locator.fill().
type
Focus the element and type text into it character by character.Deprecated: In most cases use locator.fill() instead. Only use this for special keyboard handling. For special keys use press().
press
Focus the element and press a key or key combination.Key can be a single character or a special key like “Enter”, “Control+a”, “Shift+ArrowDown”. Discouraged in favor of locator.press().
hover
Hover over the element.This method hovers over the element by performing actionability checks, scrolling into view, and simulating mouse hover. Discouraged in favor of locator.hover().
focus
Focus the element.Discouraged in favor of locator.focus().
tap
Tap the element (for touch devices).This method taps the element by performing actionability checks, scrolling into view, centering, and dispatching touchstart/touchend events. Discouraged in favor of locator.tap().
check
Check a checkbox or radio element.If the element is already checked, this method returns immediately. Discouraged in favor of locator.check().
uncheck
Uncheck a checkbox element.If the element is already unchecked, this method returns immediately. Discouraged in favor of locator.uncheck().
setChecked
Check or uncheck a checkbox or radio element.Discouraged in favor of locator.setChecked().
selectOption
Select one or more options in a <select> element.Discouraged in favor of locator.selectOption().
Options to select. Can be value, label, or option object.
Return value
setInputFiles
Set the files for a file input element.Sets the value of the file input to these file paths or files. If some paths are relative, they are resolved relative to the current working directory. Clears selected files if empty array is passed. Discouraged in favor of locator.setInputFiles().
File paths or file payloads to upload.
scrollIntoViewIfNeeded
Scroll the element into view if not already visible.If the element is detached from DOM, throws an error. Discouraged in favor of locator.scrollIntoViewIfNeeded().
dispatchEvent
Dispatch a DOM event on the element.The event is composed, cancelable and bubbles by default. Regardless of visibility, this will dispatch the event. Discouraged in favor of locator.dispatchEvent().
DOM event type, e.g., “click”.
Event-specific initialization properties.

