Screenshot Capture Testing
Cross-platform screenshot capture for visual testing, UI verification, and automated comparison. Supports full screen, specific app/window, and pixel region captures.
Tool Priority
- Prefer tool-specific screenshot capabilities when available (Playwright for browsers, Figma MCP for designs)
- Use this skill for whole-system desktop captures or when tool-specific capture cannot get what you need
- Default for desktop apps without a better-integrated capture tool
macOS Capture
Full screen
screencapture -x output/screen.png
Pixel region (x,y,w,h)
screencapture -x -R100,200,800,600 output/region.png
Specific window by ID
screencapture -x -l12345 output/window.png
Interactive selection
screencapture -x -i output/interactive.png
Linux Capture
Using scrot
# Full screen
scrot output/screen.png
# Pixel region
scrot -a 100,200,800,600 output/region.png
# Active window
scrot -u output/window.png
Using gnome-screenshot
gnome-screenshot -f output/screen.png
gnome-screenshot -w -f output/window.png
Using ImageMagick
import -window root output/screen.png
import -window root -crop 800x600+100+200 output/region.png
Windows Capture (PowerShell)
# Full screen
powershell -ExecutionPolicy Bypass -File take_screenshot.ps1
# Pixel region
powershell -ExecutionPolicy Bypass -File take_screenshot.ps1 -Region 100,200,800,600
# Active window
powershell -ExecutionPolicy Bypass -File take_screenshot.ps1 -ActiveWindow
Visual Testing Workflow
- Capture baseline — Take reference screenshots of correct UI state
- Capture current — Take screenshots of current UI state after changes
- Compare — Diff the screenshots to detect visual regressions
- Report — Generate visual diff reports with highlighted changes
Multi-Display Behavior
- macOS: Full-screen captures save one file per display with multiple monitors
- Linux/Windows: Full-screen captures use virtual desktop (all monitors in one image)
- Use
--region to isolate a single display when needed
Error Handling
- On macOS, check Screen Recording permission before window/app capture
- On Linux, verify tool availability:
command -v scrot, command -v gnome-screenshot
- If saving fails with permission errors, check directory permissions
- Always report the saved file path in the response
Best Practices
- Use consistent viewport sizes for comparable screenshots
- Mask dynamic content (timestamps, animations) before comparison
- Set appropriate diff thresholds for anti-aliasing tolerance
- Store baseline screenshots in version control
- Run visual tests in consistent environments (same OS, resolution, DPI)
1---2name: screenshot-capture-testing3description: "Cross-platform desktop and application screenshot capture for visual testing, UI verification, and automated visual comparison across macOS, Linux, and Windows."4version: 1.0.05author: openai6license: MIT7tags: [screenshot, visual, capture, desktop, cross-platform]8testingTypes: [visual, e2e]9frameworks: []10languages: [python, typescript, javascript]11domains: [web, desktop]12agents: [claude-code, cursor, github-copilot, windsurf, codex, aider, continue, cline, zed, bolt]13metadata:14 source: https://skillmd.com/skills/pramoddutta/screenshot-capture-testing15---1617# Screenshot Capture Testing1819Cross-platform screenshot capture for visual testing, UI verification, and automated comparison. Supports full screen, specific app/window, and pixel region captures.2021## Tool Priority2223- Prefer tool-specific screenshot capabilities when available (Playwright for browsers, Figma MCP for designs)24- Use this skill for whole-system desktop captures or when tool-specific capture cannot get what you need25- Default for desktop apps without a better-integrated capture tool2627## macOS Capture2829### Full screen3031```bash32screencapture -x output/screen.png33```3435### Pixel region (x,y,w,h)3637```bash38screencapture -x -R100,200,800,600 output/region.png39```4041### Specific window by ID4243```bash44screencapture -x -l12345 output/window.png45```4647### Interactive selection4849```bash50screencapture -x -i output/interactive.png51```5253## Linux Capture5455### Using scrot5657```bash58# Full screen59scrot output/screen.png6061# Pixel region62scrot -a 100,200,800,600 output/region.png6364# Active window65scrot -u output/window.png66```6768### Using gnome-screenshot6970```bash71gnome-screenshot -f output/screen.png72gnome-screenshot -w -f output/window.png73```7475### Using ImageMagick7677```bash78import -window root output/screen.png79import -window root -crop 800x600+100+200 output/region.png80```8182## Windows Capture (PowerShell)8384```powershell85# Full screen86powershell -ExecutionPolicy Bypass -File take_screenshot.ps18788# Pixel region89powershell -ExecutionPolicy Bypass -File take_screenshot.ps1 -Region 100,200,800,6009091# Active window92powershell -ExecutionPolicy Bypass -File take_screenshot.ps1 -ActiveWindow93```9495## Visual Testing Workflow96971. **Capture baseline** — Take reference screenshots of correct UI state982. **Capture current** — Take screenshots of current UI state after changes993. **Compare** — Diff the screenshots to detect visual regressions1004. **Report** — Generate visual diff reports with highlighted changes101102## Multi-Display Behavior103104- **macOS:** Full-screen captures save one file per display with multiple monitors105- **Linux/Windows:** Full-screen captures use virtual desktop (all monitors in one image)106- Use `--region` to isolate a single display when needed107108## Error Handling109110- On macOS, check Screen Recording permission before window/app capture111- On Linux, verify tool availability: `command -v scrot`, `command -v gnome-screenshot`112- If saving fails with permission errors, check directory permissions113- Always report the saved file path in the response114115## Best Practices116117- Use consistent viewport sizes for comparable screenshots118- Mask dynamic content (timestamps, animations) before comparison119- Set appropriate diff thresholds for anti-aliasing tolerance120- Store baseline screenshots in version control121- Run visual tests in consistent environments (same OS, resolution, DPI)