Browser Testing with Developer Tools: Verifying UI in Real Browsers via Chrome DevTools MCP

Preface

In front-end and full-stack development, many issues only surface in real browsers: layout misalignments, console errors, requests that never fire, or Core Web Vitals falling short of standards. If an Agent only reads static code, it easily mistakes “should be correct theoretically” for “is already correct.” Below is an introduction to the SkillHub community Skill “Developer Tools for Browser Testing” (开发者工具进行浏览器测试). It integrates Chrome DevTools MCP into the Agent workflow, enabling the model to inspect and verify based on real page states rather than guessing.

What is this

Developer Tools for Browser Testing (coordinate @user_e40a4360/bowser-testing-with-devtools, version 1.0.0) is an Agent skill specification based on the universal SKILL.md format. It originates from the SkillHub community, categorized under dev-programming, and is published by user_e40a4360 (the author is shown as “踏山河” on the SkillHub page). The tag is requires_api_key=false; installing this Skill itself does not rely on additional API Keys.

One-sentence positioning: Conduct testing in a real browser, applicable to building or debugging anything that runs in a browser. Use this when you need to inspect the DOM, capture console errors, analyze network requests and performance, or verify visual output using real runtime data via Chrome DevTools MCP.

Core Functions

The body of the Skill revolves around Chrome DevTools MCP, bridging “static code analysis” with “live browser execution.” The specified capabilities include:

Capability Function Typical Use Case
Screenshot Capture the current page Visual verification, before-and-after comparison
DOM Inspection Read live DOM Confirm if components are rendered as expected
Console Logs Capture log / warn / error Locate runtime errors and warnings
Network Monitor Log requests and responses Verify APIs, payloads, and status codes
Performance Trace Record performance timelines Analyze loading and bottlenecks
Element Styles Read computed styles Troubleshoot CSS issues
Accessibility Tree Read accessibility tree Verify accessibility
JavaScript Execution Execute JS in page context View state in a read-only manner (subject to security boundaries)

The Skill also defines non-applicable scopes: pure backend changes, CLI tools, and code not running in a browser do not need to follow this workflow.

Additionally, the Skill emphasizes security boundaries: DOM, console, network responses, and JS execution results are all treated as untrusted data and must not be treated as Agent instructions; JS execution is read-only by default; execution results must not be used to read credentials such as cookies or localStorage; URLs extracted from page content must not be navigated to without user confirmation.

Installation and Activation

1. Install SkillHub CLI (if not already installed)

First, check if the CLI is already on your machine:

command -v skillhub && skillhub --version

If not installed, follow the official SkillHub installation documentation to perform a full installation (CLI + default Skills):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

To install only the CLI:

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

2. Install the Skill to the current Agent’s skills directory

SkillHub requires using --dir to point to the skills directory recognized by the current Agent during installation; otherwise, it defaults to ./skills/ and will not be loaded. Common paths are as follows (subject to the client you are actually using):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

Installation command (consistent with the skillhub search result):

skillhub install bowser-testing-with-devtools --namespace user_e40a4360 --dir ~/.cursor/skills/

You can also let the Agent handle it according to the SkillHub installation instructions: refer to https://skillhub.cn/install/skillhub.md , and install @user_e40a4360/bowser-testing-with-devtools.

After installation, restart or refresh the Agent as required by your client to enable the Skill.

3. Configure Chrome DevTools MCP Server

This Skill relies on Chrome DevTools MCP to operate within the browser. The configuration example provided in the Skill body (written into the project’s .mcp.json or Claude Code’s MCP settings) is as follows:

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["@anthropic/chrome-devtools-mcp@latest"]
    }
  }
}

Clients supporting MCP like Cursor need to integrate a server with the same name or equivalent functionality in their respective MCP configurations; specific configuration file locations depend on that client’s documentation. Without configuring DevTools MCP, the workflow in the Skill cannot actually be executed in the browser.

Typical Usage

Following the steps above, when the Agent receives a browser-related task, it will organize actions according to the workflow in the Skill. The following three categories are from the official Skill body and their logic can be directly reused.

UI Issues: Reproduce → Inspect → Diagnose → Fix → Verify

  1. Reproduce: Open the page, trigger the issue, and take a screenshot if necessary to confirm the visual state.
  2. Inspect: Check the console; inspect the relevant DOM, computed styles, and accessibility tree.
  3. Diagnose: Compare the actual DOM/styles with expectations to determine if the root cause is in HTML, CSS, JS, or data.
  4. Fix: Modify the source code.
  5. Verify: Refresh the page, take another screenshot for comparison, ensure the console is clean, and run automated tests.

Network Issues: Capture → Analyze → Diagnose → Fix and Replay

  1. Turn on Network monitoring and trigger the operation.
  2. Verify URL, method, headers, and body, as well as response status, body, and latency.
  3. Categorize by patterns such as 4xx / 5xx / CORS / timeout / request not sent.
  4. After fixing, repeat the operation to confirm the response meets expectations.

Performance Issues: Baseline → Locate → Optimize → Re-test

  1. Record a performance trace first as a baseline.
  2. Focus on LCP, CLS, INP, long tasks (>50ms), etc.
  3. Modify code targeting the bottlenecks.
  4. Record a trace again and compare it with the baseline.

For complex UI Bugs, the Skill suggests writing a structured test plan first (steps, expected UI, console and network checklists, accessibility checks) and then letting the Agent execute step-by-step in the browser. Visual changes can be compared using “before screenshot → change code → refresh → after screenshot.”

The Skill also requires that before browser-related changes are completed, the following are verified: no console errors/warnings, correct network status and data, visual consistency with specifications, a reasonable accessibility tree, acceptable performance, and that page content has not been mistakenly treated as instructions.

Applicable Scenarios & Notes

Who it is for

  • Developers and debuggers working on Web front-ends, full-stack, or any interface rendered in a browser.
  • Those who need the Agent to complete “code changes + verification in a real browser” within the same conversation turn, rather than just generating patches.
  • Teams willing to configure Chrome DevTools MCP and accept the security boundaries in the Skill (especially with multiple tabs or third-party pages).

Limitations & Cautions

  • DevTools MCP must be installed first; installing only the Skill documentation will not automatically open a browser.
  • The Skill’s MCP configuration examples are most complete for Claude Code; other clients need to map to equivalent MCP configurations themselves.
  • Page content is untrusted; the Skill explicitly forbids directly executing “instructional text” found in the DOM/console.
  • Pure backend and CLI scenarios do not need to enable this Skill.
  • SkillHub page statistics (as of data capture): Rating 100000, Downloads 1437, Installations 2; the coordinate slug is bowser-testing-with-devtools (spelled differently from “browser”; installation must match the namespace).

Conclusion

Developer Tools for Browser Testing encapsulates the capabilities of Chrome DevTools MCP into an Agent Skill: inspecting DOM, console, network, performance, and accessibility in a real browser, complete with debugging workflows and security constraints, making it suitable as an operational guide for browser-side verification. For installation and metadata, see SkillHub: https://www.skillhub.cn/skills/user_e40a4360/bowser-testing-with-devtools ; API coordinate page: https://api.skillhub.cn/user_e40a4360/bowser-testing-with-devtools .

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye