Project 11: Browser Automation Skill - Web Testing Assistant

Project 11: Browser Automation Skill - Web Testing Assistant

Build a skill that leverages Chrome MCP to automate web testing: navigate, fill forms, click buttons, take screenshots, and verify page content.

Quick Reference

Attribute Value
Difficulty Advanced
Time Estimate 1-2 weeks
Language Markdown + JavaScript
Prerequisites Projects 9-10 completed, Chrome MCP enabled, web development basics
Key Topics Browser automation, MCP tools, DOM selectors, E2E testing
Knowledge Area Skills / Browser Automation / Testing
Main Book โ€œTesting Web APIsโ€ by Mark Winteringham

1. Learning Objectives

By completing this project, you will:

  1. Integrate skills with MCP tools: Learn how skills can orchestrate browser automation via Chrome MCP
  2. Master browser automation patterns: Navigate, interact, wait, and verify in automated tests
  3. Write reliable selectors: Create CSS and XPath selectors that donโ€™t break easily
  4. Implement wait strategies: Handle dynamic content and async operations
  5. Capture test evidence: Take screenshots and gather logs for debugging
  6. Create reusable test templates: Build patterns for common testing scenarios

2. Theoretical Foundation

2.1 Skills + MCP Tools

Skills can invoke any tool Claude has access to, including MCP (Model Context Protocol) tools. Chrome MCP provides browser automation capabilities:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    SKILL + MCP INTEGRATION                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  User: "Test the login flow on staging"                                 โ”‚
โ”‚         โ”‚                                                                โ”‚
โ”‚         โ–ผ                                                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ web-testing     โ”‚  Skill discovered, SKILL.md loaded                 โ”‚
โ”‚  โ”‚ skill           โ”‚                                                    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚                     SKILL INSTRUCTIONS                           โ”‚   โ”‚
โ”‚  โ”‚                                                                  โ”‚   โ”‚
โ”‚  โ”‚  "1. Navigate to login URL"                                     โ”‚   โ”‚
โ”‚  โ”‚        โ”‚                                                         โ”‚   โ”‚
โ”‚  โ”‚        โ–ผ                                                         โ”‚   โ”‚
โ”‚  โ”‚  mcp__claude-in-chrome__navigate                                โ”‚   โ”‚
โ”‚  โ”‚        โ”‚                                                         โ”‚   โ”‚
โ”‚  โ”‚  "2. Find username field"                                       โ”‚   โ”‚
โ”‚  โ”‚        โ”‚                                                         โ”‚   โ”‚
โ”‚  โ”‚        โ–ผ                                                         โ”‚   โ”‚
โ”‚  โ”‚  mcp__claude-in-chrome__find                                    โ”‚   โ”‚
โ”‚  โ”‚        โ”‚                                                         โ”‚   โ”‚
โ”‚  โ”‚  "3. Fill form fields"                                          โ”‚   โ”‚
โ”‚  โ”‚        โ”‚                                                         โ”‚   โ”‚
โ”‚  โ”‚        โ–ผ                                                         โ”‚   โ”‚
โ”‚  โ”‚  mcp__claude-in-chrome__form_input                              โ”‚   โ”‚
โ”‚  โ”‚        โ”‚                                                         โ”‚   โ”‚
โ”‚  โ”‚  "4. Click submit"                                              โ”‚   โ”‚
โ”‚  โ”‚        โ”‚                                                         โ”‚   โ”‚
โ”‚  โ”‚        โ–ผ                                                         โ”‚   โ”‚
โ”‚  โ”‚  mcp__claude-in-chrome__computer (click action)                 โ”‚   โ”‚
โ”‚  โ”‚                                                                  โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2.2 Chrome MCP Tool Family

The Chrome MCP extension provides these tools:

Tool Purpose
mcp__claude-in-chrome__navigate Go to URLs, back/forward
mcp__claude-in-chrome__read_page Get accessibility tree of page
mcp__claude-in-chrome__find Find elements by natural language
mcp__claude-in-chrome__form_input Set values in form fields
mcp__claude-in-chrome__computer Click, type, screenshot, scroll
mcp__claude-in-chrome__tabs_context_mcp Manage browser tabs
mcp__claude-in-chrome__get_page_text Extract text content

2.3 The Testing Pyramid and E2E Tests

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                       TESTING PYRAMID                                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚                           /\                                             โ”‚
โ”‚                          /  \                                            โ”‚
โ”‚                         /    \                                           โ”‚
โ”‚                        / E2E  \     <โ”€โ”€ This project: Browser tests     โ”‚
โ”‚                       /--------\         Slow, but tests real flow       โ”‚
โ”‚                      /          \                                        โ”‚
โ”‚                     / Integration \    API tests, component tests        โ”‚
โ”‚                    /--------------\                                      โ”‚
โ”‚                   /                \                                     โ”‚
โ”‚                  /    Unit Tests    \   Fast, isolated tests            โ”‚
โ”‚                 /โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\                                   โ”‚
โ”‚                                                                          โ”‚
โ”‚  E2E (End-to-End) tests:                                                โ”‚
โ”‚  - Test complete user flows                                             โ”‚
โ”‚  - Use real browser                                                     โ”‚
โ”‚  - Slowest but highest confidence                                       โ”‚
โ”‚  - Where this skill operates                                            โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2.4 Selector Strategies

Good selectors are stable and readable:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     SELECTOR RELIABILITY SPECTRUM                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  FRAGILE (Avoid)                      STABLE (Prefer)                   โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€                      โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€                    โ”‚
โ”‚                                                                          โ”‚
โ”‚  div > div > div > span               [data-testid="login-btn"]        โ”‚
โ”‚       โ”‚                                    โ”‚                            โ”‚
โ”‚       โ”‚  Path-based selectors              โ”‚  Test IDs are explicit    โ”‚
โ”‚       โ”‚  break with layout changes         โ”‚  and stable               โ”‚
โ”‚       โ”‚                                    โ”‚                            โ”‚
โ”‚  .css-1a2b3c                          button[type="submit"]             โ”‚
โ”‚       โ”‚                                    โ”‚                            โ”‚
โ”‚       โ”‚  Generated class names             โ”‚  Semantic selectors       โ”‚
โ”‚       โ”‚  change on rebuild                 โ”‚  match intent             โ”‚
โ”‚       โ”‚                                    โ”‚                            โ”‚
โ”‚  #element_12345                       input[name="username"]            โ”‚
โ”‚       โ”‚                                    โ”‚                            โ”‚
โ”‚       โ”‚  Dynamic IDs                       โ”‚  Form field names are     โ”‚
โ”‚       โ”‚  change each render                โ”‚  usually stable           โ”‚
โ”‚                                                                          โ”‚
โ”‚  SELECTOR PRIORITY:                                                     โ”‚
โ”‚  1. data-testid, data-cy, data-test   (added for testing)              โ”‚
โ”‚  2. Semantic attributes               (type, name, role)               โ”‚
โ”‚  3. Text content                      (button text, labels)            โ”‚
โ”‚  4. CSS classes                       (only if semantic)               โ”‚
โ”‚  5. Position/hierarchy                (last resort)                    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2.5 Wait Strategies

Timing issues are the #1 cause of flaky tests:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      WAIT STRATEGIES                                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  BAD: Fixed waits                     GOOD: Conditional waits           โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€                    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€              โ”‚
โ”‚                                                                          โ”‚
โ”‚  // Wait 3 seconds                    // Wait for element to appear     โ”‚
โ”‚  await sleep(3000);                   await waitForElement('#result');  โ”‚
โ”‚                                                                          โ”‚
โ”‚  Problems:                            Benefits:                         โ”‚
โ”‚  - Too slow if element appears fast   - Proceeds when ready            โ”‚
โ”‚  - Too fast if element takes longer   - Fails fast if never appears    โ”‚
โ”‚  - Wastes time on every run           - No unnecessary waiting          โ”‚
โ”‚                                                                          โ”‚
โ”‚  WAIT CONDITIONS:                                                       โ”‚
โ”‚                                                                          โ”‚
โ”‚  1. Element visible        - Wait until element is in DOM and visible  โ”‚
โ”‚  2. Element clickable      - Visible + enabled + not obscured          โ”‚
โ”‚  3. URL changed            - After navigation or form submit           โ”‚
โ”‚  4. Text appears           - Success message, error message            โ”‚
โ”‚  5. Element disappears     - Loading spinner gone, modal closed        โ”‚
โ”‚  6. Network idle           - All XHR/fetch requests complete           โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2.6 Test Evidence

Capture proof of what happened:

Evidence Type When to Capture Purpose
Screenshots Before/after key actions Visual proof, debugging
Console logs On errors JavaScript errors
Network logs API calls Verify backend communication
Page text After navigation Verify content loaded
Timing data Throughout Performance analysis

3. Project Specification

3.1 What You Will Build

A web testing skill that:

  1. Navigates to target URLs and verifies page load
  2. Fills forms with test data
  3. Clicks buttons and follows flows
  4. Takes screenshots as evidence
  5. Verifies expected outcomes
  6. Reports comprehensive test results

3.2 Functional Requirements

  1. Navigation:
    • Navigate to any URL
    • Handle redirects
    • Wait for page load
  2. Form Interaction:
    • Fill text inputs, selects, checkboxes
    • Handle password fields (masking in output)
    • Clear existing values before filling
  3. Actions:
    • Click buttons and links
    • Handle confirmations/alerts
    • Wait for resulting navigation
  4. Verification:
    • Check for expected text/elements
    • Verify URL after navigation
    • Detect error messages
  5. Evidence:
    • Screenshot at key moments
    • Log timing information
    • Report success/failure with details

3.3 Non-Functional Requirements

  • Reliability: Tests should be deterministic (no flakiness)
  • Speed: Use efficient waits, not fixed delays
  • Clarity: Output explains what happened and why
  • Safety: Never store/transmit real credentials

4. Real World Outcome

When you complete this project, hereโ€™s exactly what youโ€™ll experience:

You: Test the login flow on staging

Claude: [Invokes web-testing skill]

I'll test the login flow. Let me navigate to your staging environment...

Navigating to https://staging.example.com/login
Screenshot saved: 01_login_page.png

Filling login form...
- Username: test@example.com (input masked in output)
- Password: ********* (input masked in output)
- Clicking "Sign In" button...

Waiting for navigation...

Login successful!
Screenshot saved: 02_dashboard.png

Verifying dashboard elements:
- Welcome message: FOUND "Welcome, Test User"
- Navigation menu: FOUND (5 items present)
- User avatar: FOUND

Test Results:
-------------------------------------------
Login Flow: PASSED

Steps Completed:
  1. Navigate to login page     0.8s
  2. Fill username field        0.1s
  3. Fill password field        0.1s
  4. Click submit button        0.1s
  5. Wait for navigation        1.2s
  6. Verify dashboard           0.3s

Total Duration: 2.6s

Evidence:
  - Screenshots: 01_login_page.png, 02_dashboard.png
  - Test data used: test@example.com
  - Final URL: https://staging.example.com/dashboard

Would you like me to test another flow or investigate anything?

5. The Core Question Youโ€™re Answering

โ€œHow can I create a skill that orchestrates browser automation for web testing, combining Claudeโ€™s reasoning with real browser interaction?โ€

This project teaches you:

  • How skills can use MCP tools for external capabilities
  • Browser automation patterns that work reliably
  • How to structure test workflows declaratively
  • The intersection of AI assistance and automation

6. Concepts You Must Understand First

6.1 Chrome MCP Tools

Concept Questions to Answer Reference
Available tools What MCP tools exist for browser control? Claude system prompt
Tab management How do you get/use tab IDs? tabs_context_mcp tool
Element finding How do you locate elements on the page? find, read_page tools
Interactions How do you click, type, scroll? computer tool

6.2 Web Testing Patterns

Concept Questions to Answer Reference
Page Object Model How do you organize test code? Testing books
Wait strategies How do you handle async content? This guide, section 2.5
Selectors What makes a selector reliable? This guide, section 2.4
Test data How do you manage test credentials? Never hardcode production creds

6.3 DOM and Selectors

Concept Questions to Answer Reference
CSS selectors How do you select by class, ID, attribute? MDN Web Docs
Semantic selectors What attributes are stable? type, name, role, data-*
Element states How do you know if something is clickable? Accessibility tree

7. Questions to Guide Your Design

7.1 What Tests Should the Skill Support?

Consider common web testing scenarios:

Test Type Example Complexity
Login flow Fill credentials, verify dashboard Medium
Form submission Complete multi-step form High
Navigation Click links, verify pages Low
Search Enter query, verify results Medium
CRUD operations Create, read, update, delete items High

7.2 How to Make Tests Reliable?

Build reliability into your skill:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    RELIABILITY CHECKLIST                                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  Before each action:                                                    โ”‚
โ”‚  [ ] Wait for element to be present                                     โ”‚
โ”‚  [ ] Wait for element to be visible                                     โ”‚
โ”‚  [ ] Wait for element to be interactive                                 โ”‚
โ”‚                                                                          โ”‚
โ”‚  After navigation:                                                      โ”‚
โ”‚  [ ] Wait for URL to change                                             โ”‚
โ”‚  [ ] Wait for key element to appear                                     โ”‚
โ”‚  [ ] Check for error messages                                           โ”‚
โ”‚                                                                          โ”‚
โ”‚  On failure:                                                            โ”‚
โ”‚  [ ] Take screenshot                                                    โ”‚
โ”‚  [ ] Capture current URL                                                โ”‚
โ”‚  [ ] Report what was expected vs found                                  โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

7.3 What Evidence to Capture?

Evidence When Purpose
Screenshot (before) Start of test Baseline
Screenshot (after action) Form fill, click Verification
Screenshot (failure) On any error Debugging
Console messages Throughout JS errors
Timing data Each step Performance

8. Thinking Exercise

8.1 Map the Testing Workflow

Trace a login test through the skill:

1. User: "Test the login flow"

2. Skill discovers "web testing" intent
   โ””โ”€โ”€ Matches description: "web testing", "login", "browser"

3. Read SKILL.md instructions
   โ””โ”€โ”€ Follow the testing workflow

4. Testing Steps:
   a. Navigate to login URL
      โ””โ”€โ”€ Tool: mcp__claude-in-chrome__navigate
      โ””โ”€โ”€ Wait: Page loads completely

   b. Take screenshot (before)
      โ””โ”€โ”€ Tool: mcp__claude-in-chrome__computer (screenshot)

   c. Find username field
      โ””โ”€โ”€ Tool: mcp__claude-in-chrome__find
      โ””โ”€โ”€ Query: "username input" or "email field"

   d. Enter username
      โ””โ”€โ”€ Tool: mcp__claude-in-chrome__form_input
      โ””โ”€โ”€ Use ref from find step

   e. Find and enter password
      โ””โ”€โ”€ Same pattern as username

   f. Click submit
      โ””โ”€โ”€ Tool: mcp__claude-in-chrome__computer (left_click)
      โ””โ”€โ”€ On submit button location

   g. Wait for navigation
      โ””โ”€โ”€ Check URL changed
      โ””โ”€โ”€ Or check for dashboard element

   h. Verify success
      โ””โ”€โ”€ Tool: mcp__claude-in-chrome__read_page
      โ””โ”€โ”€ Look for welcome message

   i. Take screenshot (after)
      โ””โ”€โ”€ Final state evidence

5. Report results
   โ””โ”€โ”€ PASSED/FAILED + timing + screenshots

Questions to consider:

  • How do you handle login failures (wrong password)?
  • What if the selector doesnโ€™t match anything?
  • How do you parameterize test data?

9. The Interview Questions Theyโ€™ll Ask

  1. โ€œHow would you automate web testing with an AI assistant?โ€
    • Expected: Use skills to orchestrate browser tools, combining AI reasoning with automation
    • Bonus: Discuss advantages (natural language, adaptive) vs traditional frameworks
  2. โ€œWhat makes browser automation tests flaky, and how do you prevent it?โ€
    • Expected: Timing issues, dynamic content, poor selectors
    • Bonus: Smart waits, stable selectors, retry logic
  3. โ€œHow do you handle authentication in automated tests?โ€
    • Expected: Test accounts, masked credentials, donโ€™t use production data
    • Bonus: Session tokens, cookie injection, API-based login
  4. โ€œWhatโ€™s the difference between E2E testing and unit testing?โ€
    • Expected: E2E tests full flows in real browser; unit tests isolated code
    • Bonus: Testing pyramid, when to use each
  5. โ€œHow would you implement visual regression testing?โ€
    • Expected: Screenshot comparison against baselines
    • Bonus: Pixel diff tools, handling acceptable differences

10. Solution Architecture

10.1 Skill Component Diagram

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    WEB-TESTING SKILL ARCHITECTURE                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚                         SKILL.md                                  โ”‚   โ”‚
โ”‚  โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€   โ”‚   โ”‚
โ”‚  โ”‚  Orchestrator: coordinates testing workflow using MCP tools      โ”‚   โ”‚
โ”‚  โ”‚                                                                   โ”‚   โ”‚
โ”‚  โ”‚  allowed-tools:                                                  โ”‚   โ”‚
โ”‚  โ”‚    - mcp__claude-in-chrome__navigate                             โ”‚   โ”‚
โ”‚  โ”‚    - mcp__claude-in-chrome__form_input                           โ”‚   โ”‚
โ”‚  โ”‚    - mcp__claude-in-chrome__computer                             โ”‚   โ”‚
โ”‚  โ”‚    - mcp__claude-in-chrome__read_page                            โ”‚   โ”‚
โ”‚  โ”‚    - mcp__claude-in-chrome__find                                 โ”‚   โ”‚
โ”‚  โ”‚    - mcp__claude-in-chrome__tabs_context_mcp                     โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                  โ”‚                                       โ”‚
โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                  โ”‚
โ”‚              โ”‚                   โ”‚                   โ”‚                   โ”‚
โ”‚              โ–ผ                   โ–ผ                   โ–ผ                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚   templates/    โ”‚ โ”‚  SELECTORS.md   โ”‚ โ”‚  REFERENCES.md  โ”‚            โ”‚
โ”‚  โ”‚                 โ”‚ โ”‚                 โ”‚ โ”‚                 โ”‚            โ”‚
โ”‚  โ”‚ login_test.md   โ”‚ โ”‚ Common form     โ”‚ โ”‚ Best practices  โ”‚            โ”‚
โ”‚  โ”‚ form_test.md    โ”‚ โ”‚ selectors for   โ”‚ โ”‚ for web testing โ”‚            โ”‚
โ”‚  โ”‚ search_test.md  โ”‚ โ”‚ popular sites   โ”‚ โ”‚                 โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚                     CHROME MCP TOOLS                              โ”‚   โ”‚
โ”‚  โ”‚                                                                   โ”‚   โ”‚
โ”‚  โ”‚  navigate    form_input    computer    read_page    find         โ”‚   โ”‚
โ”‚  โ”‚     โ”‚            โ”‚            โ”‚            โ”‚          โ”‚           โ”‚   โ”‚
โ”‚  โ”‚     โ–ผ            โ–ผ            โ–ผ            โ–ผ          โ–ผ           โ”‚   โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚   โ”‚
โ”‚  โ”‚  โ”‚                   CHROME BROWSER                          โ”‚    โ”‚   โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

10.2 Test Execution Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    TEST EXECUTION FLOW                                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 1. SETUP        โ”‚                                                    โ”‚
โ”‚  โ”‚    Get tab ID   โ”‚  mcp__claude-in-chrome__tabs_context_mcp          โ”‚
โ”‚  โ”‚    Navigate     โ”‚  mcp__claude-in-chrome__navigate                  โ”‚
โ”‚  โ”‚    Screenshot   โ”‚  mcp__claude-in-chrome__computer (screenshot)     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 2. INTERACT     โ”‚                                                    โ”‚
โ”‚  โ”‚    Find element โ”‚  mcp__claude-in-chrome__find                      โ”‚
โ”‚  โ”‚    Fill form    โ”‚  mcp__claude-in-chrome__form_input                โ”‚
โ”‚  โ”‚    Click button โ”‚  mcp__claude-in-chrome__computer (left_click)     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 3. WAIT         โ”‚                                                    โ”‚
โ”‚  โ”‚    URL change   โ”‚  Check new URL != old URL                         โ”‚
โ”‚  โ”‚    Element      โ”‚  mcp__claude-in-chrome__read_page                 โ”‚
โ”‚  โ”‚    appears      โ”‚  Look for success indicator                        โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 4. VERIFY       โ”‚                                                    โ”‚
โ”‚  โ”‚    Check text   โ”‚  mcp__claude-in-chrome__get_page_text             โ”‚
โ”‚  โ”‚    Check URL    โ”‚  Compare to expected                              โ”‚
โ”‚  โ”‚    Check elementโ”‚  mcp__claude-in-chrome__read_page                 โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 5. EVIDENCE     โ”‚                                                    โ”‚
โ”‚  โ”‚    Screenshot   โ”‚  mcp__claude-in-chrome__computer (screenshot)     โ”‚
โ”‚  โ”‚    Log results  โ”‚  Report PASSED/FAILED                             โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

11. Implementation Guide

11.1 Phase 1: Create Skill Structure

# Create skill directory
mkdir -p ~/.claude/skills/web-testing/templates

# Create files
touch ~/.claude/skills/web-testing/SKILL.md
touch ~/.claude/skills/web-testing/SELECTORS.md
touch ~/.claude/skills/web-testing/templates/login_test.md
touch ~/.claude/skills/web-testing/templates/form_test.md

11.2 Phase 2: Write the SKILL.md

---
name: web-testing
description: Automate web browser testing including login flows, form submissions, and UI verification. Use this when the user wants to test web functionality, verify a website works, or check UI elements.
allowed-tools:
  - mcp__claude-in-chrome__navigate
  - mcp__claude-in-chrome__form_input
  - mcp__claude-in-chrome__computer
  - mcp__claude-in-chrome__read_page
  - mcp__claude-in-chrome__find
  - mcp__claude-in-chrome__tabs_context_mcp
  - mcp__claude-in-chrome__get_page_text
---

# Web Testing Assistant

Automate browser testing with reliable patterns.

## Testing Workflow

### 1. Setup

Before any test:
1. Get current tab context using `tabs_context_mcp`
2. If no tabs exist, create one with `tabs_create_mcp`
3. Store the tab ID for all subsequent operations

### 2. Navigate

1. Use `navigate` tool to go to the target URL
2. Take a screenshot immediately after navigation
3. Check for any error pages (404, 500, etc.)

### 3. Interact

For each interaction:
1. Use `find` to locate elements by natural language description
2. Verify element was found before interacting
3. For form fields: use `form_input` with the element ref
4. For clicks: use `computer` with `left_click` action
5. Take screenshots after significant actions

### 4. Wait After Actions

After form submissions or navigation triggers:
1. Check if URL changed (compare before/after)
2. Look for success/error indicators using `read_page`
3. Use `computer` with `wait` action if needed (max 5 seconds)
4. Check for loading indicators disappearing

### 5. Verify Outcomes

Verification strategies:
1. URL verification: Check current URL matches expected
2. Text verification: Use `get_page_text` to find success messages
3. Element verification: Use `read_page` to find expected elements
4. Negative verification: Ensure error messages are NOT present

### 6. Report Results

After test completion, provide:
- Overall status: PASSED or FAILED
- List of steps completed with timing
- Any failures with details
- Screenshots captured

## Common Selectors

### Login Forms
- Username: `input[name="username"]`, `input[type="email"]`, `#email`
- Password: `input[type="password"]`
- Submit: `button[type="submit"]`, `input[type="submit"]`

### Forms
- Text inputs: `input[name="fieldname"]`
- Selects: `select[name="fieldname"]`
- Checkboxes: `input[type="checkbox"]`
- Submit buttons: `button[type="submit"]`

### Navigation
- Links: `a[href*="path"]`
- Buttons: `button`, `.btn`
- Menu items: `nav a`, `.menu-item`

## Error Handling

If an action fails:
1. Take a screenshot of current state
2. Report what was expected vs what happened
3. Check for error messages on the page
4. Suggest possible causes

## Security Notes

- Never log actual password values
- Mask sensitive data in output
- Don't store credentials in test files
- Use test accounts, not production

11.3 Phase 3: Create Test Templates

templates/login_test.md:

# Login Test Template

## Test: Login Flow

### Inputs Required
- URL: Login page URL
- Username: Test username/email
- Password: Test password (will be masked in output)

### Steps

1. **Navigate to Login**
   - Go to {url}
   - Screenshot: "login_page"
   - Verify: Login form is present

2. **Fill Credentials**
   - Find username field
   - Enter: {username}
   - Find password field
   - Enter: {password} (mask in output)

3. **Submit**
   - Find submit button
   - Click submit
   - Wait for navigation

4. **Verify Success**
   - Check URL changed from login page
   - Look for dashboard/home indicators
   - Screenshot: "after_login"

### Success Criteria
- [ ] No error messages present
- [ ] URL changed to authenticated page
- [ ] User identifier visible (name, avatar)

### Failure Indicators
- Error message like "Invalid credentials"
- URL still on login page
- Login form still visible

11.4 Phase 4: Create Selectors Reference

SELECTORS.md:

# Common Web Selectors

## By Attribute Type

### Test IDs (Most Reliable)

[data-testid=โ€login-buttonโ€] [data-cy=โ€submit-formโ€] [data-test=โ€username-inputโ€]


### Form Fields

input[name=โ€emailโ€] input[type=โ€passwordโ€] select[name=โ€countryโ€] textarea[name=โ€messageโ€]


### Buttons

button[type=โ€submitโ€] button:contains(โ€œSign Inโ€) .btn-primary


## By Site Type

### Generic Login
- Username: `input[name="username"], input[type="email"], #email, #username`
- Password: `input[type="password"], #password`
- Submit: `button[type="submit"], input[type="submit"], .login-button`

### Search
- Input: `input[type="search"], input[name="q"], input[name="query"]`
- Button: `button[type="submit"], .search-button`

### Navigation
- Main nav: `nav a, .nav-link, .menu-item`
- Logo/Home: `a.logo, a[href="/"], .brand`

12. Hints in Layers

Hint 1: Start with Navigation

First, just get Claude to navigate and take a screenshot:

1. Use tabs_context_mcp to get tab ID
2. Use navigate to go to URL
3. Use computer with action: "screenshot"

Verify Chrome MCP is working before adding more complexity.

Hint 2: Add Form Filling

Use find to locate elements, then form_input with the ref:

1. find: query="username input field"
   โ†’ Returns ref like "ref_1"

2. form_input: ref="ref_1", value="test@example.com"
Hint 3: Handle Waits

After clicking submit, verify the action completed:

1. Click submit button
2. Use computer with action: "wait", duration: 2
3. Read page and check for success element
4. Or check URL changed from login to dashboard
Hint 4: Create Test Templates

Add templates/ directory with patterns for common tests.

In SKILL.md, reference them: โ€œFor login tests, follow the pattern in templates/login_test.mdโ€


13. Common Pitfalls & Debugging

13.1 Frequent Mistakes

Pitfall Symptom Solution
No tab ID โ€œMust provide tab IDโ€ errors Always call tabs_context_mcp first
Element not found Empty find results Use more specific/natural queries
Timing issues Actions fail intermittently Add waits after navigation/clicks
Wrong selector Clicking wrong element Use find tool with natural language
Password in logs Credentials visible Mask sensitive values in output

13.2 Debugging Steps

  1. Take screenshots frequently: See exactly what Claude sees
  2. Check tab context: Is Claude using the right tab?
  3. Use read_page: See the accessibility tree
  4. Try find tool: Verify elements can be located
  5. Check console: Look for JavaScript errors

14. Extensions & Challenges

14.1 Beginner Extensions

  • Add support for multi-step forms
  • Handle โ€œRemember meโ€ checkboxes
  • Verify specific text content

14.2 Intermediate Extensions

  • Visual regression testing (compare screenshots)
  • Network request verification
  • Handle authentication cookies
  • Test across multiple pages

14.3 Advanced Extensions

  • Parallel test execution
  • Test data parameterization
  • Retry logic for flaky tests
  • Integration with CI/CD

15. Books That Will Help

Topic Book/Resource Chapter/Section
Web testing โ€œTesting Web APIsโ€ by Winteringham Chapters 3-5
E2E patterns โ€œThe Art of Software Testingโ€ Chapter 8
DOM manipulation MDN Web Docs Selectors guide
Browser automation Playwright/Puppeteer docs Getting started

16. Self-Assessment Checklist

Understanding

  • I understand how skills invoke MCP tools
  • I can explain wait strategies and why they matter
  • I know what makes selectors reliable vs fragile
  • I understand the testing pyramid

Implementation

  • Browser navigation works reliably
  • Forms are filled correctly
  • Screenshots are captured at key moments
  • Tests report clear results

Growth

  • I can add new test patterns as templates
  • I can debug failing tests using screenshots
  • I understand when to use browser testing vs other approaches

17. Learning Milestones

Milestone Indicator
Browser navigation works You understand Chrome MCP basics
Forms are filled correctly You understand selectors and input
Tests handle timing Youโ€™ve implemented wait strategies
Tests report results Youโ€™ve created a complete workflow

This guide was expanded from CLAUDE_CODE_MASTERY_40_PROJECTS.md. For the complete learning path, see the project index.