Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteIn Playwright, “screen size” usually means the web page’s viewport—the width and height, in CSS pixels, that responsive code can see. Set it in Playwright Test with use.viewport, set it for a single test with test.use(), configure it on a browser context, or resize an existing page with page.setViewportSize(). Playwright Test’s documented default is 1280 × 720 pixels.
This is different from enlarging the operating system’s visible browser window. Use viewport settings for repeatable layout tests; only use browser launch arguments for an outer-window workaround when you understand the browser-specific risks.
What “screen size” means in Playwright
There are three related settings that are easy to confuse:
- Viewport: The emulated page area, measured in CSS pixels. This controls media queries, responsive breakpoints, and the layout available to the page.
- Device emulation: A preset that can include viewport, screen size, user agent, touch support, and other device characteristics.
- Outer browser window: The visible desktop window supplied by the operating system. It is not the same as the page viewport and is not a portable way to test responsive layouts.
For most “make the screen larger” questions, increase the viewport width and height. For example, a 1600 × 1200 viewport gives the page more CSS-pixel space without requiring a larger physical monitor.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Playwright’s viewport is independent of deviceScaleFactor. The latter changes the emulated device pixel ratio; it does not increase the page’s CSS width or height.
Increase the viewport for an entire Playwright project
Use the use.viewport option in playwright.config.ts when a project or most of its tests should run at one fixed size.
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
viewport: { width: 1600, height: 1200 },
},
});
Run the suite normally:
npx playwright test
The setting is applied to each test context and its pages. Keeping the dimensions in configuration makes screenshots, responsive assertions, and CI runs deterministic.
Use a project matrix for desktop sizes
If you need several desktop breakpoints, define separate projects rather than changing the viewport unpredictably inside tests.
import { defineConfig } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'desktop-wide',
use: { viewport: { width: 1600, height: 1000 } },
},
{
name: 'desktop-standard',
use: { viewport: { width: 1280, height: 720 } },
},
],
});
A project matrix makes a failure identify the exact dimensions that exposed it.
Change the viewport for one test file or block
Use test.use() when only a file or a group of tests needs a larger viewport. This keeps the rest of the suite at its normal size.
import { test, expect } from '@playwright/test';
test.use({ viewport: { width: 1440, height: 900 } });
test('wide navigation is visible', async ({ page }) => {
await page.goto('https://example.com');
await expect(page.getByRole('navigation')).toBeVisible();
});
You can also scope the option to a block:
import { test } from '@playwright/test';
test.describe('wide layout', () => {
test.use({ viewport: { width: 1920, height: 1080 } });
test('renders the desktop layout', async ({ page }) => {
await page.goto('https://example.com');
});
});
Place the setting before the tests in that scope. A nested block can override an outer value.
Resize one page during a test
For a page created by the Playwright Test page fixture, call page.setViewportSize():
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallRank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
import { test, expect } from '@playwright/test';
test('checks two responsive layouts', async ({ page }) => {
await page.setViewportSize({ width: 1600, height: 1000 });
await page.goto('https://example.com');
await expect(page.locator('body')).toBeVisible();
await page.setViewportSize({ width: 800, height: 600 });
await expect(page.getByRole('button', { name: 'Menu' })).toBeVisible();
});
Set the size before navigation whenever possible. Many sites do not expect a phone-sized viewport to change after the page has loaded; scripts may have already selected a layout, measured elements, or installed event handlers. If you must resize after navigation, wait for the UI to settle before asserting it.
Read the current dimensions
Browser-side JavaScript can verify what the page receives:
const size = await page.evaluate(() => ({
width: window.innerWidth,
height: window.innerHeight,
}));
console.log(size);
window.innerWidth and window.innerHeight are CSS-pixel viewport dimensions. They are not the physical monitor size and can differ from an element’s bounding box or the full document height.
Set the viewport when using Playwright Library directly
If you create a browser yourself rather than using Playwright Test, put viewport in browser.newContext(). Every page in that context inherits the value.
import { chromium } from 'playwright';
const browser = await chromium.launch();
const context = await browser.newContext({
viewport: { width: 1600, height: 1200 },
});
const page = await context.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'wide.png', fullPage: true });
await browser.close();
Use a separate context when two sizes must run independently. Contexts isolate cookies, storage, and emulation settings, so a resize in one does not silently alter another.
Use a device descriptor, then override its viewport
Device descriptors are appropriate when width and height are only part of the test. They can configure a user agent, screen characteristics, touch support, and other device behavior. Import a descriptor from playwright and spread it into a new context or test configuration.
import { chromium, devices } from 'playwright';
const browser = await chromium.launch();
const context = await browser.newContext({
...devices['iPhone 13'],
viewport: { width: 500, height: 900 },
});
const page = await context.newPage();
await page.goto('https://example.com');
await browser.close();
The explicit viewport appears after the spread, so it overrides the preset viewport. The descriptor’s other characteristics remain in effect. In Playwright Test, the equivalent is:
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'custom-phone-width',
use: {
...devices['iPhone 13'],
viewport: { width: 500, height: 900 },
},
},
],
});
Record a larger viewport with codegen
When generating a test interactively, pass --viewport-size to Playwright Codegen:
Recommended Free Tools
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
npx playwright codegen --viewport-size="1600,1000" https://playwright.dev
Replace the example dimensions and URL with your target. Codegen opens the recorder at that viewport and produces actions that you can save into a test. The option changes the generated session; put the resulting dimensions in your project configuration if the test must remain reproducible when run later.
When the viewport is not enough
Full-page screenshots versus a taller viewport
A taller viewport shows more content at once, but it does not make the document itself shorter. For a screenshot of the complete page, use fullPage: true:
await page.screenshot({ path: 'page.png', fullPage: true });
This captures the full scrollable document using the current viewport width. It is different from increasing the viewport height.
Outer window size and headed mode
A visible desktop window can be affected by browser launch arguments, but that is separate from the page viewport. The Playwright options documentation shows --start-maximized as an example Chromium argument and warns that custom browser arguments may break Playwright functionality. It is not documented as a portable, exact-dimension solution across Chromium, Firefox, and WebKit.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →If your test is about responsive behavior, do not replace use.viewport with window manipulation. If you are diagnosing a headed-only visual issue, treat outer-window changes as a browser-specific workaround and validate the resulting window.innerWidth.
Host-dependent sizing with viewport: null
Setting viewport: null lets the viewport depend on the host window. This can be useful for an interactive headed session, but the dimensions then vary with the developer machine, display scaling, window manager, and CI environment. Playwright documents this as nondeterministic; fixed width and height are preferable for repeatable tests.
Choose dimensions deliberately
There is no universally correct “large” size. Pick dimensions that represent a supported layout or a risk you want to exercise.
- Desktop regression: Start with the project’s documented desktop breakpoint, then add a wider case such as 1440 or 1600 pixels if navigation or data tables change at large widths.
- Responsive boundaries: Test just below and just above each CSS breakpoint, not only a very wide and a very narrow screen.
- Visual snapshots: Keep width, height, browser engine, and device scale factor stable so diffs represent page changes rather than environment changes.
- Long pages: Keep a realistic viewport height and use full-page capture when the requirement is document coverage.
- Touch devices: Use a descriptor when touch, user agent, or mobile behavior matters; changing width alone does not emulate a phone.
Document the reason for unusual dimensions in the configuration. A 1920-pixel test that exists to expose a horizontal overflow bug is easier to maintain when that intent is explicit.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Troubleshooting viewport-size problems
The page still looks narrow
- Confirm the setting is in the configuration actually used by the command. A different project may have its own
use.viewport. - Check that you changed the viewport, not only
deviceScaleFactor. - Log
window.innerWidthandwindow.innerHeightafter navigation. - Look for application CSS that imposes a fixed
max-width; Playwright cannot remove a site’s own layout constraint.
A device preset keeps restoring its old size
Spread the descriptor first and put your explicit viewport afterward. The later property wins in JavaScript object construction:
use: {
...devices['Pixel 5'],
viewport: { width: 600, height: 900 },
}
Changing size after navigation causes broken layout
Move page.setViewportSize() before page.goto(). If a test intentionally exercises live resizing, wait for the application’s resize work to complete and assert behavior rather than relying on a screenshot taken immediately after the call.
The test passes locally but fails in CI
Check for viewport: null, outer-window dependencies, and browser-specific launch arguments. Replace host-dependent sizing with explicit dimensions. Run the same project and browser engine locally as CI, and record the actual viewport in failure diagnostics.
Only a portion of the page appears in the screenshot
A larger viewport is not a full-page capture. Use fullPage: true, or scroll and capture sections when the page contains lazy-loaded content that must be triggered explicitly.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Or skip the browser setup
If the goal is simply to obtain a clean screenshot at a chosen viewport, ScreenshotNeo provides a GET endpoint instead of requiring local browser installation and viewport orchestration. The service accepts the URL and returns PNG, JPEG, or WebP; its options include any viewport, full-page capture with lazy images loaded, device presets, retina scale, CSS-selector element capture, dark mode, custom CSS and JavaScript, click and wait actions, request blocking, headers, cookies, user agents, timezone, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous jobs, webhooks, and bulk capture of up to 100 URLs per call.
Example cURL request (see the ScreenshotNeo documentation for the complete parameter list):
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://stripe.com
-d viewport_width=1600
-d viewport_height=1200
-o shot.webp
Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.
Python and Node.js alternatives for ScreenshotNeo
The same endpoint can be called from application code. Keep the API key private and set a request timeout appropriate for the page being rendered.
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={
"access_key": "YOUR_API_KEY",
"url": "https://stripe.com",
"viewport_width": 1600,
"viewport_height": 1200,
},
timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://stripe.com',
viewport_width: '1600',
viewport_height: '1200'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const data = Buffer.from(await res.arrayBuffer());
await Bun.write('shot.webp', data);
Quick reference
| Need | Use |
|---|---|
| Every test in a project | use.viewport in playwright.config.ts |
| One file or describe block | test.use({ viewport: { width, height } }) |
| Direct Playwright Library context | browser.newContext({ viewport: { width, height } }) |
| Resize one existing page | await page.setViewportSize({ width, height }) |
| Generate a test interactively | npx playwright codegen --viewport-size="width,height" URL |
| Emulate a device plus custom dimensions | Spread a device descriptor, then set viewport |
| Use the host window | viewport: null, with nondeterministic dimensions |
FAQ
What is Playwright’s default screen size?
Playwright Test documents a default viewport of 1280 × 720 pixels.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Can I set a viewport larger than my monitor?
Yes. The viewport is an emulated CSS-pixel area, so it does not have to match the physical display attached to the machine.
Does increasing the viewport emulate a larger device?
No. A viewport changes page dimensions. Device emulation also changes characteristics such as user agent and touch behavior.
Which setting should I use for responsive tests?
Use fixed use.viewport or test.use() values. They are more repeatable than relying on an OS window.
Free tools Windows power users keep installed
One-click scans. No signup required.
Frequently Asked Questions
What is Playwright’s default screen size?
Playwright Test documents a default viewport of 1280 × 720 pixels.
Can I set a viewport larger than my monitor?
Yes. The viewport is an emulated CSS-pixel area, so it does not have to match the physical display attached to the machine.
Does increasing the viewport emulate a larger device?
No. A viewport changes page dimensions. Device emulation also changes characteristics such as user agent and touch behavior.
Which setting should I use for responsive tests?
Use fixed use.viewport or test.use() values. They are more repeatable than relying on an OS window.
Quick Recap
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.

