selectText
Selects all text content of the element.This method waits for actionability checks, then focuses the element and selects all text content.
highlight
Highlights the element on screen (for debugging).Useful for debugging during test development. Not recommended for production tests.
boundingBox
Returns the bounding box of the element, or null if not visible.Returns { x, y, width, height } in pixels relative to the main frame viewport.
Scrolling affects the coordinates. Returns null if element is not visible.
Return value
elementHandle
Resolves to the ElementHandle of the element.Returns the handle to the element that matches this locator.
Throws if no elements or multiple elements match.
Return value
elementHandles
Resolves to all ElementHandles matching this locator.Returns an empty array if no elements match.
Return value
and
Creates a locator that matches both this locator AND the argument.Both conditions must be satisfied for an element to match.
Additional locator to match
Return value
or
Creates a locator that matches this locator OR the argument.Either condition being satisfied will match. Be careful with strict mode -
if both match, use .first() to select one.
Alternative locator to match
Return value
contentFrame
Returns a FrameLocator pointing to the iframe this locator points to.Useful when you have a Locator to an iframe and want to interact with its content.
Return value
page
Returns the Page that this locator belongs to. Upstream docsReturn value

