webapp-testing
What it does
This tool helps test websites you are developing on your computer. It allows you to check if everything is working correctly, take 'pictures' of the screen, and see error messages.
When to use it
- βWhen you want to see if a button on your website works.
- βWhen you want to take a screenshot of how your website looks.
- βWhen you want to check for errors happening on the website.
Skill link
https://github.com/anthropics/skills/blob/main/skills/webapp-testing/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCheck if the 'Save' button works on my profile page and take a screenshot.β
5 new skills a week. 1 minute to read.
How it works
You write a small Python program that uses the tool to open your website, interact with it, and check if everything is as expected. It can even start your website's server for you.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Web Application Testing
To test local web applications, write native Python Playwright scripts.
Helper Scripts Available:
scripts/with_server.py- Manages server lifecycle (supports multiple servers)
Always run scripts with --help first to see usage. DO NOT read the source until you try running the script first and find that a customized solution is abslutely necessary. These scripts can be very large and thus pollute your context window. They exist to be called directly as black-box scripts rather than ingested into your context window.
Decision Tree: Choosing Your Approach
User task β Is it static HTML?
ββ Yes β Read HTML file directly to identify selectors
β ββ Success β Write Playwright script using selectors
β ββ Fails/Incomplete β Treat as dynamic (below)
β
ββ No (dynamic webapp) β Is the server already running?
ββ No β Run: python scripts/with_server.py --help
β Then use the helper + write simplified Playwright script
β
ββ Yes β Reconnaissance-then-action:
1. Navigate and wait for networkidle
2. Take screenshot or inspect DOM
3. Identify selectors from rendered state
4. Execute actions with discovered selectors
Example: Using with_server.py
To start a server, run --help first, then use the helper:
Single server:
python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_automation.py
Multiple servers (e.g., backend + frontend):
python scripts/with_server.py \
--server "cd backend && python server.py" --port 3000 \
--server "cd frontend && npm run dev" --port 5173 \
-- python your_automation.py
To create an automation script, include only Playwright logic (servers are managed automatically):
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True) # Always launch chromium in headless mode
page = browser.new_page()
page.goto('http://localhost:5173') # Server already running and ready
page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS to execute
# ... your automation logic
browser.close()
Reconnaissance-Then-Action Pattern
Inspect rendered DOM:
page.screenshot(path='/tmp/inspect.png', full_page=True) content = page.content() page.locator('button').all()Identify selectors from inspection results
Execute actions using discovered selectors
Common Pitfall
β Don't inspect the DOM before waiting for networkidle on dynamic apps
β
Do wait for page.wait_for_load_state('networkidle') before inspection
Best Practices
- Use bundled scripts as black boxes - To accomplish a task, consider whether one of the scripts available in
scripts/can help. These scripts handle common, complex workflows reliably without cluttering the context window. Use--helpto see usage, then invoke directly. - Use
sync_playwright()for synchronous scripts - Always close the browser when done
- Use descriptive selectors:
text=,role=, CSS selectors, or IDs - Add appropriate waits:
page.wait_for_selector()orpage.wait_for_timeout()
Reference Files
- examples/ - Examples showing common patterns:
element_discovery.py- Discovering buttons, links, and inputs on a pagestatic_html_automation.py- Using file:// URLs for local HTMLconsole_logging.py- Capturing console logs during automation
FAQ
What does 'headless' mean?
It means the browser opens without showing a window on the screen, running in the background to automate tasks.
Why should I wait for 'networkidle'?
This ensures the website has finished loading all information and animations before you try to interact with or check something.
What are 'selectors'?
They are like addresses the tool uses to find specific buttons, texts, or fields on your website.
Details
Original description by the author
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
repo: anthropics/skills
Popularity
- GitHub stars
- 181k
- Ranking position
- #652
- License
- β
- Updated
- 10/9/2026
Comments
- β¦
More skills from this repository
academy-guide
181kHas your agent recommend courses and tutorials for learning Claude. It's useful when you have questions about how to use Claude or its products.
algorithmic-art
181kHelps your agent create art using code, generating unique images. It's useful when you want original computer-generated art.
brand-guidelines
181kHas your agent apply Anthropic's brand colors and visual style to materials. It's useful for maintaining the company's visual identity across projects.
canvas-design
181kHelps your agent create beautiful visual art in files. It's useful when you ask for a poster, art, or any static design.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.