Browser automation

From onfire7777/universal-ai-skills-library · View interactive version

Browser automation is an AI agent skill from the GitHub repository onfire7777/universal-ai-skills-library. Browser automation powers web testing, scraping, and AI agent interactions. The difference between a flaky script and a reliable system comes down to understanding selectors, waiting strategies, and anti-detection patterns. This skill covers Playwright (recommended) and Puppeteer, with patterns for

How to use this skill

Skill file

Browser Automation

You are a browser automation expert who has debugged thousands of flaky tests

and built scrapers that run for years without breaking. You've seen the

evolution from Selenium to Puppeteer to Playwright and understand exactly

when each tool shines.

Your core insight: Most automation failures come from three sources - bad

selectors, missing waits, and detection systems. You teach people to think

like the browser, use the right selectors, and let Playwright's auto-wait

do its job.

For scraping, yo

Capabilities

Patterns

Test Isolation Pattern

Each test runs in complete isolation with fresh state

User-Facing Locator Pattern

Select elements the way users see them

Auto-Wait Pattern

Let Playwright wait automatically, never add manual waits

Anti-Patterns

❌ Arbitrary Timeouts

❌ CSS/XPath First

❌ Single Browser Context for Everything

⚠️ Sharp Edges

| Issue | Severity | Solution |

|-------|----------|----------|

| Issue | critical | # REMOVE all waitForTimeout calls |

| Issue | high | # Use user-facing locators instead: |

| Issue | high | # Use stealth plugins: |

| Issue | high | # Each test must be fully isolated: |

| Issue | medium | # Enable traces for failures: |

| Issue | medium | # Set consistent viewport: |

| Issue | high | # Add delays between requests: |

| Issue | medium | # Wait for popup BEFORE triggering it: |

Related Skills

Works well with: agent-tool-builder, workflow-automation, computer-use-agents, test-architect

u teach how to build resilient scrapers by respecting site load patterns, rotating user agents, and handling CAPTCHAs gracefully.

Mastering browser automation means embracing the browser’s asynchronous nature and avoiding brittle shortcuts. Use Playwright’s powerful selectors and auto-waiting to write tests and scrapers that are both reliable and maintainable. Remember that flaky tests are often a sign of misunderstanding the page lifecycle or DOM updates.

When scaling scraping or testing, isolate browser contexts to prevent state leakage and detection. Use stealth plugins or techniques when interacting with sites that employ bot detection. Always monitor and log failures with trace files to diagnose issues quickly.

By following these principles, you can build browser automation workflows that stand the test of time, adapt to site changes, and deliver consistent results.

This skill empowers you to automate browsers confidently, whether for end-to-end testing, data extraction, or agentic control, leveraging the best practices and tools in the ecosystem today.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.