Puppeteer Element Handle
All Element Handle methods available when using the Puppeteer driver.
Access via elementHandle after launching a Puppeteer runtime.
How these methods work over HTTP
Every method below is a remote call. The SDK translates it into a structured step sent to a single endpoint:
The call field maps directly to the method name. args is a JSON array of the method’s arguments. You can batch multiple steps in one request.
Actions
click(options?)
Click the element.
hover()
Hover over the element.
tap()
Tap the element (for touch devices).
focus()
Focus the element.
type(text, options?)
Type text into the element.
press(key, options?)
Press a key while focused on the element.
select(…values)
Select options in a <select> element.
Returns string[]
— An array of selected option values.
dragAndDrop(target, options?)
Drag and drop to another element or point.
Queries
$(selector)
Query for a child element.
Returns RemotePuppeteerElementHandle \| null
— The matching element or null if not found.
$$(selector)
Query for all matching child elements.
Returns RemotePuppeteerElementHandle[]
— An array of matching elements.
$x(expression)
Query for child elements by XPath. (Uses $$() with xpath prefix internally)
XPath queries are deprecated. Consider using CSS selectors instead.
Returns RemotePuppeteerElementHandle[]
contentFrame()
Get the content frame for iframe elements.
Returns RemotePuppeteerFrame \| null
— The frame or null if not an iframe.
Content
getProperty(propertyName)
Get a property value.
Returns T
jsonValue()
Get the JSON value of the element.
Returns T
backendNodeId()
Get the backend node ID (Chrome DevTools Protocol).
This value is stable for the lifetime of the node. The SDK caches this value after the first call.
Returns number
boundingBox()
Get the bounding box of the element.
Returns PuppeteerBoundingBox \| null
— The bounding box or null if the element is not visible.
State Checks
isVisible()
Check if the element is visible.
Returns boolean
isHidden()
Check if the element is hidden.
Returns boolean
isIntersectingViewport(options?)
Check if the element intersects the viewport.
Returns boolean
Waiting
waitForSelector(selector, options?)
Wait for a child element to appear.
Returns RemotePuppeteerElementHandle \| null
Screenshots & PDF
screenshot(options?)
Take a screenshot of the element.
Returns base64 string by default. If options.encoding is “binary”, the SDK converts the base64 to a Buffer.
Returns string \| Buffer
Evaluation
evaluate(pageFunction, …args)
Evaluate a function in the context of the element.
The element is passed as the first argument to the function.
Returns T
$eval(selector, pageFunction, …args)
Evaluate a function on the first child matching the selector.
Returns T
$$eval(selector, pageFunction, …args)
Evaluate a function on all children matching the selector.
Returns T
Other
uploadFile(…filePaths)
Upload files to a file input element.
scrollIntoView()
Scroll the element into view.
autofill(data)
Test if the form is compatible with browser autofill. Currently supports credit card autofill in Chrome headless/headful only.
boxModel()
Get the CSS box model of the element.
Returns PuppeteerBoxModel \| null
— The box model or null if the element is not visible.
clickablePoint(offset?)
Get a clickable point within the element.
Returns PuppeteerPoint
frame()
Get the owning frame of this element.
Returns RemotePuppeteerFrame
drag(target)
Drag the element to the given target.
Returns PuppeteerDragData \| void
dragEnter(data?)
Dispatch a dragenter event.
Deprecated: dragenter is automatically performed during dragging.
dragOver(data?)
Dispatch a dragover event.
Deprecated: dragover is automatically performed during dragging.
drop(element)
Drop the given element onto the current one.
touchStart()
Start a touch in the center of the element.
Scrolls element into view if needed.
Returns TouchHandle
— A TouchHandle for controlling this touch point.
touchMove(touch?)
Move the touch to the center of the element.
Scrolls element into view if needed.
touchEnd()
End the first active touch.
toElement(tagName)
Convert to a typed element handle.
Throws if the element is not of the specified tag type. Do NOT dispose the original handle - both handles reference the same element.
Returns RemotePuppeteerLocator
dispose()
Dispose of the handle, releasing it from the backend registry.
After disposal, any method calls will throw. The SDK sets the disposed flag before the RPC call to prevent race conditions.

