Capture the image in your Playwright test with await page.screenshot({ path: 'screenshots/home.png' }), then upload the screenshots/ directory as a GitHub Actions artifact after the test command. Put the upload step behind if: ${{ !cancelled() }} (or an equivalent condition) so failed tests still leave evidence. The workflow must install Playwright’s browsers and Linux dependencies with npx playwright install --with-deps.
1. Choose the screenshot you actually need
Playwright creates screenshots in the test process; GitHub Actions only preserves the resulting files. Choose the capture scope before designing the artifact layout.
Viewport screenshot
Use a normal page screenshot for what is visible in the current viewport:
await page.screenshot({ path: 'screenshots/home-viewport.png' });
This is usually the best evidence for a responsive breakpoint or a failure visible above the fold.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitches#1 Best Overall
- Compatible with Nintendo Switch 2’s new GameChat mode
- Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
- Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
- Built-In Mic: The built-in microphone lets others hear you clearly during video calls
- Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
Full-page screenshot
Set fullPage: true to capture the complete scrollable document:
await page.screenshot({
path: 'screenshots/home-full.png',
fullPage: true
});
Very long pages can produce large files and take longer to encode and upload, so reserve this option for visual review or page-length regressions.
Element screenshot
Capture only a component when the rest of the page is irrelevant:
await page.locator('[data-testid="checkout-summary"]').screenshot({
path: 'screenshots/checkout-summary.png'
});
Locator screenshots reduce file size and make a failure easier to inspect. Playwright also supports returning screenshot bytes instead of writing a file, which is useful when you want to transform or attach the image directly.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
See the Playwright screenshot guide, Page API and Locator API for the complete option set.
2. Write screenshots to a predictable test output path
A fixed directory works for a small suite, but parallel tests can overwrite one another if they use the same filename. Use Playwright Test’s managed output path for test-specific evidence:
import { test, expect } from '@playwright/test';
test('home page renders', async ({ page }, testInfo) => {
await page.goto('https://example.com');
const image = await page.screenshot({
path: testInfo.outputPath('home.png'),
fullPage: true
});
await testInfo.attach('home screenshot', {
body: image,
contentType: 'image/png'
});
await expect(page).toHaveTitle(/Example/);
});
testInfo.outputPath() keeps files inside the test’s own output directory. testInfo.attach() associates an image with that test in reporters that support attachments. The TestInfo API documents both approaches.
Rank #2
- Compatible with Nintendo Switch 2’s new GameChat mode
- Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
- The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
- C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
- The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
Keep a screenshot when a test fails
For broad failure evidence, add a conditional screenshot in a fixture or test hook. The exact hook depends on your suite, but the important rules are to use a unique output path and avoid masking the original failure:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →import { test as base } from '@playwright/test';
export const test = base.extend({
page: async ({ page }, use, testInfo) => {
await use(page);
if (testInfo.status !== testInfo.expectedStatus) {
await page.screenshot({
path: testInfo.outputPath('failure.png'),
fullPage: true
});
}
}
});
If the browser has already crashed, no screenshot can be produced; preserve the test output and trace as well so the artifact still explains the failure.
3. Install Playwright correctly on the runner
Hosted Linux runners do not automatically contain the browser binaries and all system libraries your project needs. A dependable job checks out the repository, installs Node dependencies, installs browsers with dependencies, and then runs tests.
name: Playwright
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers and Linux dependencies
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- name: Upload screenshots
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v5
with:
name: playwright-screenshots
path: screenshots/
retention-days: 14
The action tag and 14-day retention above are examples. Confirm the current actions/upload-artifact version and your repository’s retention policy before committing the workflow. The official CI pattern is documented in the Playwright CI guide.
4. Upload screenshots as artifacts
After a job finishes, an artifact is the downloadable bundle of files created on the runner. The upload step’s path must match the directory your tests actually write.
Upload on both success and failure
GitHub Actions normally stops later steps after a failed run. if: ${{ !cancelled() }} permits the upload after a test failure while still skipping it when the entire job is cancelled. Put the upload after npx playwright test; placing it before the test command produces an empty or stale artifact.
Upload test-managed output
If screenshots live under Playwright’s output directory rather than a top-level screenshots/ folder, point the action at that directory, for example:
Rank #3
- 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
- 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
- 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
- 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
- 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
- name: Upload Playwright test output
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v5
with:
name: playwright-test-output
path: test-results/
retention-days: 14
Upload a separate, clearly named artifact when you want raw image files and a browsable HTML report to be downloaded independently.
Keep the HTML report too
Playwright’s CI example uploads its report as an artifact. Add a report step using the same failure-safe condition, adjusting the path to your configuration:
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v5
with:
name: playwright-report
path: playwright-report/
retention-days: 30
Use report artifacts for navigation and image artifacts when someone needs the original files directly. Do not assume the example retention period is appropriate for your organization.
5. Make filenames safe for parallel and repeated runs
- Use
testInfo.outputPath(), or include the test title and project name in a filename. - Do not let every browser project write
screenshots/home.pngto the same path. - Keep one artifact name per matrix entry or include the matrix value in the artifact name.
- Use PNG for lossless pixel comparison; use JPEG or WebP only when smaller files are more important than exact pixels.
For full-page captures, consider whether the page contains animations, timestamps, ads or lazy-loaded content. Disable or wait for those sources of nondeterminism before capturing, otherwise a visual diff may report changes unrelated to your code.
6. Sharded workflows need an artifact hand-off
Each GitHub Actions job has its own filesystem. A screenshot created in shard 1 is not visible to shard 2 or to a later merge job until it is uploaded and downloaded.
Give each shard a unique artifact name:
- name: Upload shard screenshots
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v5
with:
name: playwright-screenshots-shard-${{ matrix.shard }}
path: screenshots/
retention-days: 14
A dependent job can then download all shard artifacts before producing a combined report. Playwright’s sharding guide describes the analogous blob-report upload and merge flow. Avoid two jobs uploading to the same artifact name unless your chosen action behavior and naming strategy explicitly support it.
7. Diagnose common failures
“Executable doesn’t exist” or browser launch failure
The runner has the Node package but not its browser binaries, or Linux libraries are missing. Run npx playwright install --with-deps in the job after npm ci. For launch diagnostics, set DEBUG=pw:browser on the test step and inspect the log.
Rank #4
- 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
- Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
- Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
- Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
- High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
- name: Run tests with browser diagnostics
env:
DEBUG: pw:browser
run: npx playwright test
The CI guidance for installation and diagnostics is in the Playwright CI guide.
The artifact is missing
Check three things: the test actually reached the screenshot call, the runner created the expected directory, and the upload action’s path exactly matches it. Add a temporary diagnostic such as find . -maxdepth 3 -type f if the location is unclear. A cancelled job cannot upload; a failed test can when the condition is !cancelled().
The screenshot is overwritten
Two tests or projects are using the same fixed filename. Move the file under testInfo.outputPath() or generate unique names from test metadata.
The screenshot is blank or incomplete
Wait for the page state that matters rather than assuming navigation completion means rendering is complete. Wait for a selector, fonts, API data and lazy images before calling screenshot(). If the page is intentionally dynamic, freeze animations and mock volatile responses where practical.
The upload succeeds but files are not useful
Upload the directory containing the actual images, not only a report’s metadata. If you need per-test context, attach the buffer or path with testInfo.attach() and also retain the test output directory.
8. Security, retention and cost considerations
CI screenshots, traces, reports and console logs can expose test credentials, access tokens, source code or application data. Treat artifacts as sensitive: restrict repository and artifact permissions, use trusted storage, encrypt files when appropriate, and retain them only as long as the debugging or review process requires. The Playwright CI setup guide calls out these risks.
Full-page and multi-browser captures increase storage and upload time. Capture the smallest useful scope, avoid duplicate screenshots on every passing test, and reserve long retention for release evidence. A failure-only policy often gives developers the evidence they need without retaining every routine run.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Best Value
- Compatible with Nintendo Switch 2’s new GameChat mode
- HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
- Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
- Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
- Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server when you need a clean capture without managing Playwright browsers in your workflow. One GET request returns PNG, JPEG, WebP or PDF; its pre-capture cleanup accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status.
For a simple capture, see the ScreenshotNeo API documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. Options include full-page and CSS-selector captures, dark mode, device presets, retina scale, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, timezone, geolocation, transparent backgrounds, resizing, configurable caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification.
The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to try it.
Recommended Free Tools
9. A practical workflow checklist
- Choose viewport, full-page or locator scope.
- Write to a unique path, preferably
testInfo.outputPath()for test-linked evidence. - Install dependencies with
npm ciandnpx playwright install --with-deps. - Run tests before the upload step.
- Use
if: ${{ !cancelled() }}so failures retain evidence. - Match the artifact path to the directory created on the runner.
- Use unique artifact names for matrix and sharded jobs.
- Restrict access and set retention according to the sensitivity of the images.
Frequently Asked Questions
Where do I download the screenshots in GitHub?
Open the completed workflow run, select the job, and use its Artifacts section to download the named ZIP bundle.
Can GitHub Actions upload screenshots from a failed test?
Yes. Place the upload step after the test command and guard it with if: ${{ !cancelled() }}; this allows it to run after a test failure but not after cancellation.
Should I use an artifact or a Playwright attachment?
Use an artifact for a downloadable directory or report, and testInfo.attach() when the image should appear in the context of a particular test result. You can use both.
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.
Free tools Windows power users keep installed
One-click scans. No signup required.

