Skip to main content
Locator screenshots & pdf methods for the Playwright driver.

screenshot

Takes a screenshot of the element.
Waits for actionability checks and scrolls element into view. Returns screenshot clipped to element size and position.
Upstream docs
options
PlaywrightScreenshotOptions
result
Buffer
Return value
await locator.screenshot();