← 返回案例库
CUSTOMER STORY · 跨系统流程自动化

Claude Code 连上 Chrome:写功能、自己点开测试、发现并修复错误

Test local web apps and fix errors in one session

Tools · 使用工具Claude Code · Claude in Chrome
Source · 来源原作者 · test-lab.ai
Zaowuyun · 可参考能力智能体工作台 + 技能库
01

谁在用

Who

一个开发团队的实践分享。

02

遇到什么问题

Challenge

写完前端功能后要切到浏览器手动测试、看控制台、再回来改代码。

03

怎么用 AI 解决

Solution
  1. 用 claude --chrome 或 /chrome 把 Claude in Chrome 扩展连到 Claude Code,共享开发者真实的 Chrome 会话和登录。
  2. 要求给仪表盘表格加筛选:Claude 写组件、打开页面试用筛选。
  3. 发现 URL 查询参数没更新,修复路由逻辑并再次验证。
04

结果如何

Results据原作者自述
  • 筛选功能三轮迭代完成,开发者无需手动操作浏览器
  • 只能在本机可见的 Chrome 窗口运行,不支持 CI 或无头模式;每次浏览器交互约占 7.7% 上下文

以上内容均由原作者自行报告,未经独立核实,也不代表造物云产品的效果。

05

提示词

Prompt

参考提示词(由 agentusecases.ai 整理为模板,非原帖原文)

中文

用【启动命令】在本地启动应用,在 Chrome 中打开【localhost 网址】,走一遍【功能或流程】。读取浏览器控制台和网络错误,在代码中找原因并修复,重复直到没有控制台错误,最后总结改动。

ENGLISH

Start my app locally with [start command], then open it in Chrome at [localhost URL] and click through [feature or flow]. Read the browser console and network errors, find the cause in the code, and fix it. Repeat until the flow works with no console errors. Then summarize what you changed. Don't commit or push anything without asking me.