DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
Mountain View desk4 min

How to Screenshot a Website at Google Pixel 7a Size with Playwright

Playwright’s built-in Pixel 7a profile sets a 412 × 839 CSS-pixel viewport, mobile behavior, touch support, and a 2.625 device scale factor. Here’s how to use it for viewport or full-page captures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Playwright’s built-in Pixel 7a device profile, then call page.screenshot(). The profile uses a 412 × 839 CSS-pixel viewport—not the phone’s 1080 × 2400 physical display resolution—and also sets mobile behavior, touch support, and a device scale factor of 2.625.

Use Playwright’s Pixel 7a profile

Playwright includes a named Pixel 7a descriptor with device settings for browser emulation. Its current values are a 412 × 839 CSS-pixel viewport, a 412 × 915 screen, a device scale factor of 2.625, mobile mode, touch support, and Chromium as the default browser type. See the Playwright device descriptor source and the Playwright emulation guide.

As an Amazon Associate I earn from qualifying purchases.

Configure a Playwright Test project

In playwright.config.ts, spread the device descriptor into a project’s use settings:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'Pixel 7a',
      use: {
        ...devices['Pixel 7a'],
      },
    },
  ],
});

Then take a screenshot in a test. This captures the visible viewport by default:

#1 Best Overall
import { test } from '@playwright/test';

test('capture at Pixel 7a size', async ({ page }) => {
  await page.goto('https://example.com');
  await page.screenshot({ path: 'pixel-7a.png' });
});

Run the test using your project’s usual Playwright Test command. The configured project supplies the Pixel 7a emulation settings to the page.

Create a one-off browser context

If you are using Playwright directly rather than Playwright Test, create a context from the same descriptor. This example uses the asynchronous JavaScript API with Chromium:

Rank #2
Google Pixel 7a 5G, 128GB, Sea - Unlocked (Renewed)
  • Camera description: Rear
  • At a Glance shows you useful info that you need at the right time, like weather alerts, a package delivery or baggage claim info when your flight lands
  • Wireless network technology : CDMA
  • Connectivity technology : Bluetooth
import { chromium, devices } from 'playwright';

const browser = await chromium.launch();
const context = await browser.newContext({ ...devices['Pixel 7a'] });
const page = await context.newPage();

await page.goto('https://example.com');
await page.screenshot({ path: 'pixel-7a.png' });

await browser.close();

Understand Pixel 7a viewport versus screen resolution

“Pixel 7a resolution” can mean the dimensions used to lay out a webpage or the physical resolution of the phone’s display. For responsive web testing, the relevant value is Playwright’s 412 × 839 CSS-pixel viewport. The descriptor’s screen value is 412 × 915. Google lists the Pixel 7a’s physical display as 1080 × 2400 pixels, with a 20:9 aspect ratio and a 6.1-inch diagonal (Google Pixel phone hardware specifications).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not set the Playwright viewport to 1080 × 2400 to test a phone-sized layout. The device scale factor maps CSS pixels to device pixels in emulation; it is not a multiplier to apply to the CSS viewport when configuring it.

Rank #3
Google Pixel 7a, 128GB, Snow - Unlocked (Renewed)
  • Camera description : Rear
  • Connectivity technology : Bluetooth
  • Display.size : 6.1 inches
  • Memory storage capacity : 128.0 GB
  • Operating system : Android 13.0

Choose viewport or full-page capture

page.screenshot() captures the current visible area. For a long page image that continues below the emulated viewport, set fullPage: true:

await page.screenshot({ path: 'pixel-7a-full.png', fullPage: true });

A full-page screenshot extends the image beyond the visible phone screen; it does not make the emulated viewport taller. Use viewport capture when you need to inspect what fits on screen, and full-page capture when you need the whole document in one image.

What Playwright emulation does—and does not—verify

Playwright describes its device support as emulation. The Pixel 7a profile gives repeatable browser settings for testing a mobile layout, but a screenshot made with it is not proof that the page was captured on an actual Pixel 7a handset or that every hardware-specific behavior matches one. Use a real device when validation on the physical phone is a requirement. For version-specific results, check the installed Playwright package’s devices['Pixel 7a'] values: the descriptor in the project’s main branch can change and may differ from an older local package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting

  • The profile is undefined or the project cannot find Pixel 7a. Confirm that the installed Playwright package exposes devices['Pixel 7a']. The descriptor in the current source may not be present in an older installed version; check that package’s device registry before relying on its dimensions.
  • The result is much larger than a phone screenshot. Check whether you set fullPage: true. That option captures the document beyond the viewport. Remove it to capture only the visible area.
  • The mobile layout does not appear. Make sure the page or context uses the full descriptor, including its mobile and touch settings, rather than only a manually specified viewport. In Playwright Test, confirm the test is running in the project configured with ...devices['Pixel 7a'].
  • The CSS layout looks incorrectly scaled. Set the viewport in CSS pixels using the device profile. Do not substitute Google’s 1080 × 2400 physical display dimensions or multiply the viewport by the 2.625 device scale factor.
  • The page screenshot is blank or incomplete. Check that navigation reached the intended page before capturing and that the site’s content has loaded. A screenshot call captures the page state at the time it runs; add an appropriate readiness condition for the page you are testing if it renders content asynchronously.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you only need a website screenshot rather than Playwright-based device emulation, ScreenshotNeo can return an image or PDF from one GET request. Its API does not document a Pixel 7a device profile, so use Playwright above when that exact emulation is required. ScreenshotNeo removes cookie banners, popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed; and its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month with no card.

Quick Recap

Bestseller No. 1
Bestseller No. 2
Google Pixel 7a 5G, 128GB, Sea - Unlocked (Renewed)
Google Pixel 7a 5G, 128GB, Sea - Unlocked (Renewed)
Camera description: Rear; Wireless network technology : CDMA; Connectivity technology : Bluetooth
$219.99
Bestseller No. 3
Google Pixel 7a, 128GB, Snow - Unlocked (Renewed)
Google Pixel 7a, 128GB, Snow - Unlocked (Renewed)
Camera description : Rear; Connectivity technology : Bluetooth; Display.size : 6.1 inches; Memory storage capacity : 128.0 GB
$219.95
Best Value
Google Pixel 7-5G Android Phone - Unlocked Smartphone with Wide Angle Lens and 24-Hour Battery - 256GB - Lemongrass
  • Google Pixel 7 is powered by Google Tensor G2; it’s faster, more efficient, and more secure, with the best photo and video quality yet on Pixel[1].Other camera description:Front,Rear.Bluetooth Version 5.2 with dual antennas for enhanced quality and connection.
  • Unlocked Android 5G phone gives you the flexibility to change carriers and choose your own data plan[2]; works with Google Fi, Verizon, T-Mobile, AT&T, and other major carriers
  • Pixel’s Adaptive Battery can last over 24 hours; when Extreme Battery Saver is turned on, it can last up to 72 hours[3]
  • The 6.3-inch Pixel 7 display is super sharp, with rich, vivid colors; it’s fast and responsive for smoother gaming, scrolling, and moving between apps[4]
  • Google Pixel 7 has wide and ultrawide lenses with up to 8x Super Res Zoom[5]; and Cinematic Blur brings more drama to your videos

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.