Skip to main content
Element Handle other methods for the Playwright driver.

boundingBox

Get the bounding box of the element.
Discouraged in favor of locator.boundingBox().
Upstream docs
result
PlaywrightBoundingBox | null
Return value
await element.boundingBox();

contentFrame

Get the content frame for iframe elements. Upstream docs
result
RemotePlaywrightFrame | null
Return value
await element.contentFrame();

ownerFrame

Get the frame that owns this element. Upstream docs
result
RemotePlaywrightFrame | null
Return value
await element.ownerFrame();

asElement

Return this handle as an ElementHandle.
Since this is already an ElementHandle, returns itself.
Upstream docs
result
RemotePlaywrightElementHandle | null
Return value
await element.asElement();

dispose

Dispose of the handle, releasing it from the browser.
After disposal, any method calls will throw. The SDK sets the disposed flag before the RPC call to prevent race conditions.
Upstream docs
await element.dispose();

getProperties

Get a map of property names to JSHandles. Upstream docs
result
Map<string, RemotePlaywrightJSHandle>
Return value
await element.getProperties();