Skip to content
masterclass Buddy

Playwright · Function

page.screenshot

Playwright can capture the visible page, the full scrollable page, or one element. Save the image to a file or receive its bytes in memory.

Last updated

Syntax

await page.screenshot({ path: 'screenshot.png', fullPage: true });
await page.locator('.header').screenshot({ path: 'header.png' });

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • page.screenshot
  • locator.screenshot

Source: Screenshots | Playwright. Checked 2026-11-03.