Of the 24 Locator methods, browser sessions serve 22, phone sessions 7 and computer sessions 23. A method marked not served answers StrategyUnavailable on that kind of session; check the handshake’s capabilities before relying on one.

Locator.fill

Browser: served Phone: served Computer: served Takes targetId Resolve the locator on the current screen, wait until the target is attached, visible, enabled and editable (terms as Locator.click defines them), focus it, then type text into it, all on the session in one round trip. Fails with ActionTimeout when the target never becomes actionable within timeoutMs. When it reads the screen (strategy vision, or no accessibility tree), it also fails with ActionTimeout when the locator matches several elements on a settled screen; the message lists them, and nth picks one.
{"id": 1, "method": "Locator.fill", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}, "text": "hello"}}
ParamTypeRequiredDescription
observestringNoReturn the page’s state after the action in the same reply: url (its URL and title) or snapshot (those and the first part of Page.ariaSnapshot with refs and compact). It waits up to 5 seconds for a navigation the action started. One of url, snapshot.
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
forcebooleanNoSkip the actionability checks (Playwright’s force).
textstringYes
inputstringNoHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.press

Browser: served Phone: served Computer: served Takes targetId Press a key, as Keyboard.keyPress does. With a locator, the target is resolved, waited for and focused first, and fails as Locator.fill does on several matches; without one, the key goes to whatever has focus.
{"id": 1, "method": "Locator.press", "params": {"key": "enter"}}
ParamTypeRequiredDescription
observestringNoReturn the page’s state after the action in the same reply: url (its URL and title) or snapshot (those and the first part of Page.ariaSnapshot with refs and compact). It waits up to 5 seconds for a navigation the action started. One of url, snapshot.
locatorSelectorNoWhich element: a selector object tagged by kind. See Selectors.
keystringYesA named key, or a single printable character. Playwright’s spellings of named keys (“Enter”, “ArrowDown”, “PageUp”) are accepted too.
modifiersstring[]NoModifier keys to hold. A session that cannot hold modifiers answers StrategyUnavailable. One of ctrl, shift, alt, meta.
inputstringNoHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.click

Browser: served Phone: not served Computer: served Takes targetId Resolve the locator, wait until the target is attached, visible, stable, enabled and receives events, then click it. Fails as Locator.fill does on timeout or several matches. Actionability terms: attached (in the document), visible (rendered with a non-empty box), stable (not moving between two frames), enabled (not disabled), editable (not read-only), receives events (not covered by another element at the point the action lands).
{"id": 1, "method": "Locator.click", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
observestringNoReturn the page’s state after the action in the same reply: url (its URL and title) or snapshot (those and the first part of Page.ariaSnapshot with refs and compact). It waits up to 5 seconds for a navigation the action started. One of url, snapshot.
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
forcebooleanNoSkip the actionability checks (Playwright’s force).
trialbooleanNoRun the actionability checks without acting (Playwright’s trial).
positionElementPositionNoWhere on the target to act, in CSS pixels from its padding box’s top-left, as Playwright’s position. Omitted means the center.
buttonstringNoThe mouse button to use. One of left, right, middle. Default "left".
clickCountintegerNoClicks in quick succession; 2 is a double click. Omitted means 1. Default 1.
modifiersstring[]NoModifier keys to hold. A session that cannot hold modifiers answers StrategyUnavailable. One of ctrl, shift, alt, meta.
inputstringNoHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.hover

Browser: served Phone: not served Computer: served Takes targetId Resolve the locator, wait until the target is attached, visible, stable and receives events (terms as Locator.click defines them), then move the pointer over it.
{"id": 1, "method": "Locator.hover", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
observestringNoReturn the page’s state after the action in the same reply: url (its URL and title) or snapshot (those and the first part of Page.ariaSnapshot with refs and compact). It waits up to 5 seconds for a navigation the action started. One of url, snapshot.
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
forcebooleanNoSkip the actionability checks (Playwright’s force).
trialbooleanNoRun the actionability checks without acting (Playwright’s trial).
positionElementPositionNoWhere on the target to act, in CSS pixels from its padding box’s top-left, as Playwright’s position. Omitted means the center.
inputstringNoHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.selectOption

Browser: served Phone: not served Computer: served Takes targetId Resolve a select element, wait until it is attached, visible and enabled (terms as Locator.click defines them), then choose the options matching values or labels (one of the two). Choosing several needs a multiple select. Works on select elements only: any other target, such as a custom dropdown, fails with InvalidArgs (use Locator.click).
{"id": 1, "method": "Locator.selectOption", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
observestringNoReturn the page’s state after the action in the same reply: url (its URL and title) or snapshot (those and the first part of Page.ariaSnapshot with refs and compact). It waits up to 5 seconds for a navigation the action started. One of url, snapshot.
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
forcebooleanNoSkip the actionability checks (Playwright’s force).
valuesstring[]NoOption values to choose.
labelsstring[]NoOption labels (visible text) to choose.
inputstringNoHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.setChecked

Browser: served Phone: not served Computer: served Takes targetId Resolve a checkbox or radio button, wait as Locator.click does, and make its checked state match checked, clicking it only when it does not already.
{"id": 1, "method": "Locator.setChecked", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}, "checked": true}}
ParamTypeRequiredDescription
observestringNoReturn the page’s state after the action in the same reply: url (its URL and title) or snapshot (those and the first part of Page.ariaSnapshot with refs and compact). It waits up to 5 seconds for a navigation the action started. One of url, snapshot.
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
forcebooleanNoSkip the actionability checks (Playwright’s force).
trialbooleanNoRun the actionability checks without acting (Playwright’s trial).
checkedbooleanYes
inputstringNoHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.scrollIntoView

Browser: served Phone: not served Computer: served Takes targetId Resolve the locator, wait until the target is attached and stable (terms as Locator.click defines them), then scroll until it is in view.
{"id": 1, "method": "Locator.scrollIntoView", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.setInputFiles

Browser: served Phone: not served Computer: served Takes targetId Resolve a file input, wait only until it is attached (file inputs are often hidden), and set its files, replacing any already chosen: uploads names files staged with Browser.stageUpload; fileIds names Files library files (not served yet). An empty list clears it.
{"id": 1, "method": "Locator.setInputFiles", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
uploadsstring[]NoNames of files staged with Browser.stageUpload.
fileIdsstring[]NoIDs of files in the organization’s Files library.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.waitFor

Browser: served Phone: served Computer: served Takes targetId Block on the session until the locator reaches the requested state (visible by default), re-resolving against each fresh frame. One call replaces a client-side polling loop.
{"id": 1, "method": "Locator.waitFor", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
statestringNoThe state to wait for; visible by default. attached and detached wait for the target to be in or out of the document, visible or not. enabled needs the accessibility tree or the DOM (vision cannot tell). One of visible, hidden, enabled, attached, detached.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.boundingBox

Browser: served Phone: served Computer: served Takes targetId Wait until the locator resolves, then return the target’s bounds: window pixels, or the page’s CSS pixels with space viewport (as Playwright’s boundingBox).
{"id": 1, "method": "Locator.boundingBox", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
spacestringNoThe space a call’s coordinates and returned bounds are in. screen is the desktop’s pixels from its top-left: the only space in a computer session, and its default there. In a browser session window (the default) is window pixels. viewport is the page’s CSS pixels from the main frame viewport’s top-left, as Playwright’s page.mouse and boundingBox use; under it a point outside the viewport fails with InvalidArgs. One of window, viewport, screen. Default "window".
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.getAttribute

Browser: served Phone: not served Computer: served Takes targetId Wait until the locator resolves, then return the named DOM attribute (null when absent).
{"id": 1, "method": "Locator.getAttribute", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
namestringNoThe attribute getAttribute reads; ignored by the other reads.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
valuestring | nullWhat the method reads; null when the target has none (an absent attribute).
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.textContent

Browser: served Phone: not served Computer: served Takes targetId Wait until the locator resolves, then return its DOM text content, including text that is not rendered.
{"id": 1, "method": "Locator.textContent", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
namestringNoThe attribute getAttribute reads; ignored by the other reads.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
valuestring | nullWhat the method reads; null when the target has none (an absent attribute).
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.innerText

Browser: served Phone: not served Computer: served Takes targetId Wait until the locator resolves, then return its rendered text, as the browser computes innerText.
{"id": 1, "method": "Locator.innerText", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
namestringNoThe attribute getAttribute reads; ignored by the other reads.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
valuestring | nullWhat the method reads; null when the target has none (an absent attribute).
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.inputValue

Browser: served Phone: not served Computer: served Takes targetId Wait until the locator resolves, then return a form control’s current value, which can differ from its value attribute.
{"id": 1, "method": "Locator.inputValue", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
namestringNoThe attribute getAttribute reads; ignored by the other reads.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
valuestring | nullWhat the method reads; null when the target has none (an absent attribute).
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.accessibleName

Browser: not served Phone: served Computer: served Takes targetId Wait until the locator resolves through the accessibility tree, then return its computed accessible name.
{"id": 1, "method": "Locator.accessibleName", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
namestringNoThe attribute getAttribute reads; ignored by the other reads.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
valuestring | nullWhat the method reads; null when the target has none (an absent attribute).
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.count

Browser: served Phone: served Computer: served Takes targetId Count the targets matching the locator on the current screen, zero included. Never waits.
{"id": 1, "method": "Locator.count", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
countinteger
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.evaluate

Browser: served Phone: not served Computer: served Takes targetId Resolve the locator, wait until the target is attached, then call expression with the element and args in world, as Page.evaluate. Results, limits, timeouts and idempotencyKey are as Page.evaluate; it also reports how the element was found.
{"id": 1, "method": "Locator.evaluate", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}, "expression": "() => document.title"}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
expressionstringYesCalled with the element first, then args.
argsany[]NoJSON values passed to the expression, in order.
allbooleanNoCall expression once with an array of every match (empty when none) instead of the one element, without waiting, as Playwright’s evaluateAll.
worldstringNoWhere a script runs. isolated shares the page’s DOM but not its JavaScript, and the page can’t see it. main is the page’s own context: it can read the page’s variables and call its functions, and the page can observe the script, so use it only when a call needs page JavaScript. One of isolated, main. Default "isolated".
awaitPromisebooleanNoDefault true.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
valueanyThe JSON result; null is a value.
exceptionScriptException
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.dispatchEvent

Browser: served Phone: not served Computer: served Takes targetId Resolve the locator, wait until the target is attached, then dispatch an event of type on it with eventInit. A programmatic event, not input: it skips the page’s real input handling, so use Locator.click for a click.
{"id": 1, "method": "Locator.dispatchEvent", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}, "type": "click"}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
typestringYesThe event type, e.g. “click” or “input”.
eventInitobjectNoThe event’s init dictionary.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.innerHTML

Browser: served Phone: not served Computer: served Takes targetId Wait until the locator resolves, then return the target’s inner HTML.
{"id": 1, "method": "Locator.innerHTML", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
namestringNoThe attribute getAttribute reads; ignored by the other reads.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
valuestring | nullWhat the method reads; null when the target has none (an absent attribute).
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsinteger
modelNamestringThe model that resolved the target when resolvedBy is vlm.

Locator.getStates

Browser: served Phone: not served Computer: served Takes targetId The target’s states, as Playwright’s isVisible, isEnabled, isEditable, isChecked and isFocused read them. Waits until the target is attached, unless noWait, which answers at once with attached false when nothing matches. Strict like the actions, noWait included: several matches fail as Locator.fill does unless nth picks one. checked is null for a target that can’t be checked. isHidden is not visible, and a target that isn’t attached counts as hidden.
{"id": 1, "method": "Locator.getStates", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
noWaitbooleanNo
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
attachedboolean
visibleboolean
enabledboolean
editableboolean
checkedboolean | null
focusedboolean
tookMsinteger

Locator.focus

Browser: served Phone: not served Computer: served Takes targetId Resolve the locator, wait until attached, then focus the target as script does.
{"id": 1, "method": "Locator.focus", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.blur

Browser: served Phone: not served Computer: served Takes targetId Resolve the locator, wait until attached, then remove focus from the target.
{"id": 1, "method": "Locator.blur", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.dragTo

Browser: served Phone: not served Computer: served Takes targetId Press on the source, move to the target, and release, each waited for as Locator.click waits. Positions are as Locator.click’s position. The pointer moves through intermediate points under either input, so pages that drag on pointer events work as well as HTML5 drag and drop.
{"id": 1, "method": "Locator.dragTo", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}, "target": {"kind": "text", "value": "Trash"}}}
ParamTypeRequiredDescription
observestringNoReturn the page’s state after the action in the same reply: url (its URL and title) or snapshot (those and the first part of Page.ariaSnapshot with refs and compact). It waits up to 5 seconds for a navigation the action started. One of url, snapshot.
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
forcebooleanNoSkip the actionability checks (Playwright’s force).
trialbooleanNoRun the actionability checks without acting (Playwright’s trial).
targetSelectorYesWhich element: a selector object tagged by kind. See Selectors.
sourcePositionElementPositionNoWhere on the target to act, in CSS pixels from its padding box’s top-left, as Playwright’s position. Omitted means the center.
targetPositionElementPositionNoWhere on the target to act, in CSS pixels from its padding box’s top-left, as Playwright’s position. Omitted means the center.
inputstringNoHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.

Locator.tap

Browser: not served Phone: served Computer: not served The phone’s pointer action: resolve the locator, wait until the target is actionable, then tap its centre. Fails with ActionTimeout when the target never becomes actionable within timeoutMs. Browsers answer Locator.click instead.
{"id": 1, "method": "Locator.tap", "params": {"locator": {"kind": "role", "role": "button", "name": "Sign in"}}}
ParamTypeRequiredDescription
locatorSelectorYesWhich element: a selector object tagged by kind. See Selectors.
strategystringNoWhich resolver finds the target: auto, dom, vision or accessibility. Browsers serve dom (and auto, which means dom); phones serve auto, vision and accessibility. See Strategies.
timeoutMsintegerNoBudget for the whole call in milliseconds, auto-wait included. 0 or omitted means 5000; at most 60000. Running out is ActionTimeout.
ocrEnginestringNoPhones only: the OCR tier for the vision resolver, free or premium. Omitted means the default.
modelstringNoPhones only: the model the vision resolver and natural-language queries use. Omitted means the default.
idempotencyKeystringNoMakes a re-send after a reconnect safe: a repeated key returns the recorded response without acting again. See Idempotency keys.
Result
FieldTypeDescription
navigatedbooleanA navigation the action started committed before it returned (click and press wait up to 10 s for one that starts within 150 ms, as Playwright does).
observedObservationThe page right after the action, for a call with observe.
resolvedBystringHow the target was resolved: dom (the page’s DOM), a11y (an accessibility tree), ocr (text read from a screenshot), vlm (a point a vision model grounded on a screenshot), or model (a model picked one element from the page’s or desktop’s candidates, for kind query). One of dom, a11y, ocr, vlm, model.
boundsBbox
tookMsintegerEnd-to-end time on the session, auto-wait included.
modelNamestringThe model that resolved the target when resolvedBy is vlm.
inputstringHow the input reaches the page. Browsers serve os (the default), real operating system input; simulated answers StrategyUnavailable.