Selenium 扩展
🎥Plug & Play
Watch the demo
本教程介绍如何把 Selenium MCP 服务器 添加为 goose 扩展,用来自动化浏览器操作,例如打开网页和填写表单。
快速安装
- goose Desktop
- goose CLI
命令
npx -y @angiejones/mcp-selenium
配置
信息
运行此命令需要系统已安装 Node.js,因为会用到 npx。
- goose Desktop
- goose CLI
- Launch the installer
- Click
Yesto confirm the installation - Click the button in the top-left to open the sidebar
- Navigate to the chat
- Run the
configurecommand:
goose configure
- Choose to add a
Command-line Extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◆ What type of extension would you like to add?
│ ○ Built-in Extension
│ ● Command-line Extension (Run a local command or script)
│ ○ Remote Extension (Streamable HTTP)
└
- Give your extension a name.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◆ What would you like to call this extension?
│ Selenium
└
- Enter the command to run when this extension is used.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Selenium
│
◆ What command should be run?
│ npx -y @angiejones/mcp-selenium
└
- Enter the number of seconds goose should wait for actions to complete before timing out. Default is
300seconds.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Selenium
│
◇ What command should be run?
│ npx -y @angiejones/mcp-selenium
│
◆ Please set the timeout for this tool (in secs):
│ 300
└
- Enter a description for this extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Selenium
│
◇ What command should be run?
│ npx -y @angiejones/mcp-selenium
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Enter a description for this extension:
│ Automates browser interactions
└
- Choose
Nowhen asked to add environment variables.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Selenium
│
◇ What command should be run?
│ npx -y @angiejones/mcp-selenium
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Enter a description for this extension:
│ Automates browser interactions
│
◆ Would you like to add environment variables?
│ No
│
└ Added Selenium extension
使用示例
下面用 goose 从零做一个测试自动化项目。我们用 Selenium MCP 自动填写网页表单,再让 goose 生成一份 Selenium 项目代码,方便以后再次运行这些测试。
goose 提示词
用 selenium 打开 heroku formy 站点,用通用数据填写表单页。然后把你做的事情变成一份自动化脚本。我希望用 Java,并使用 Page Object Model 模式。