Clicks the element.
Optionaloptions: ClickOptions & { offset?: Point }
click options (button, clickCount, delay, offset)
A copy of this locator.
Calls the handlers of event with data; true when there were any.
Optionaldata: unknownFills an input, textarea, select or contenteditable element with value.
Optionaloptions: Record<string, unknown>A copy that only accepts values for which predicate(value), run in the page, is true.
Moves the mouse over the element.
Optionaloptions: Record<string, unknown>The number of handlers for event.
A copy whose found value is mapper(value), run in the page.
Removes handler (or every handler, without handler) for event.
Optionalhandler: (...args: any[]) => voidAdds handler for event. The locator emits LocatorEvent.Action right before click, fill, hover and
scroll; a handler that throws makes the action fail.
Adds handler for the next event only.
Removes every handler of event, or of every event.
Optionalevent: stringScrolls the element to scrollTop / scrollLeft.
Optionaloptions: { scrollLeft?: number; scrollTop?: number }A copy that scrolls (true) or does not scroll (false) the element into the viewport before acting.
A copy of this locator whose actions time out after timeout milliseconds (0 = no timeout).
A copy that waits for the element to be "visible", "hidden", or neither (null).
A copy that waits (true) or does not wait (false) for the element to be enabled.
A copy that waits (true) or does not wait (false) for the element's bounding box to be stable.
Waits for the element (or the mapped value) and returns it as JSON.
Optionaloptions: Record<string, unknown>Staticrace
Describes how to find an element and acts on it once it is ready: attached, visible, enabled and stable (unless turned off). Each action waits and retries until the locator's timeout. Created by Page.locator, Frame.locator, ElementHandle.asLocator and Locator.race.
A locator is an immutable description: the
set…,map,filterandclonemembers return a new locator, and nothing runs in the page until an action (click,fill,hover,scroll,wait,waitHandle) is called.pjsc differences:
Locator.racenested at most 4 deep, and at most 64 locators in one race tree.signaloption is ignored: every action ends with the render.click,fill,hoverandscrollwait until pjsc's own navigation to the request url has finished.