CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Selenium SIDE Runner

$ selenium-side-runner 基金会 中风险
SeleniumHQ · 浏览器与网页抓取 · Apache-2.0 · macos / linux / windows

Selenium SIDE Runner(selenium-side-runner)是官方提供的 Node.js CLI,用于在 Chrome、Firefox 或远端 Selenium Grid 上运行由 Selenium IDE 录制的 .side 测试项目。其底层基于 Jest,支持 -w 并行 worker、--output-directory 配合 --output-format jest(JSON)或 junit 报告输出,以及通过 -c 传入无头浏览器参数。

FCRS-1.0 综合评分
75 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
npm install -g selenium-side-runner
CLI vs MCP 选型建议 仅 CLI 可用

专用于在 CI 中回放 Selenium IDE .side JSON 录制文件的测试运行器,并非通用交互式 Agent 浏览器。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
— 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 18 / 25

支持非交互执行并通过 --output-directory 与 --output-format jest 导出 JSON 报告,但开启无头模式需编写较冗长的 -c 能力参数。

  • Supports --output-directory with --output-format jest|junit
  • Headless requires -c 'goog:chromeOptions.args=[--headless=new]'
安全与权限边界 20 / 25

仅按录制好的 .side 步骤在目标 URL 执行确定性测试,并仅将报告写入本地目录。

  • Runs scoped .side test suites; writes reports only to --output-directory
安装与运行摩擦 11 / 15

可通过 npm/npx 跨平台安装,但本地运行仍需在 PATH 中安装版本匹配的 chromedriver、geckodriver 或连接 Selenium Grid。

  • Requires separately installed WebDriver executables (chromedriver, etc.)
能力覆盖与边际价值 11 / 15

适合在 CI 中并行回放(-w)Selenium IDE 录制的 .side 测试,但灵活性不及 Playwright 或 WebdriverIO。

  • Supports -w parallel workers, --filter, and --base-url
维护与来源背书 7 / 10

SeleniumHQ 官方项目(SeleniumHQ/selenium-ide),采用 Apache-2.0 协议,但迭代节奏慢于 Selenium 核心项目。

  • Official SeleniumHQ/selenium-ide Apache-2.0 repository
文档与可验证性 8 / 10

selenium.dev 提供专门的命令行运行器文档,说明能力配置与 .side.yml 用法。

  • CLI runner documentation at selenium.dev/selenium-ide

安全边界、鉴权与放权指南

鉴权方式
无需鉴权 本地配置文件
凭证存储位置

可选从 .side.yml 或 CLI 参数读取 Grid 地址与浏览器能力配置,不存储凭据。

潜在副作用
只读查询 本地写入 远端写入
费用与配额提示

免费且基于 Apache-2.0 开源的 SeleniumHQ 工具包。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# selenium-side-runner Agent Rules
- Always pass headless capability args via `-c` (or `.side.yml`) because there is no standalone `--headless` flag.
- Use `--output-directory <dir> --output-format jest` for machine-readable JSON test reports.
- Ensure matching `chromedriver` / `geckodriver` is installed on `PATH` before running locally.

Agent 高频安全命令配方

只读查询(安全推荐)

以无头 Chrome 运行 .side 测试套件并写入 JSON 结果
selenium-side-runner -c 'browserName=chrome goog:chromeOptions.args=[--headless=new]' --output-directory ./results --output-format jest suite.side

在无头 Chrome 中执行 suite.side,并将 Jest 格式 JSON 结果保存至 ./results。

查看 CLI 参数与能力配置语法
selenium-side-runner --help

打印支持的 Grid、浏览器能力(-c)、并发(-w)与输出格式参数。

核心优势

  • + 可直接针对本地浏览器或 Selenium Grid 并行(-w)回放 .side 测试录制文件。
  • + 支持通过 --output-directory 导出结构化 Jest JSON 或 JUnit XML 报告。

注意事项与踩坑点

  • ! 没有简洁的 --headless 布尔开关,必须通过 -c 或 .side.yml 传入浏览器能力参数。
  • ! 本地执行要求在 PATH 上安装与浏览器版本匹配的 chromedriver 或 geckodriver。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI