Selenium AI Agent
v3.9.0Selenium MCP: plan, review, generate, heal tests; JUnit/Allure reports linked to the plan
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
go_back
Navigate back in browser history
| Parameter | Type | Description |
|---|---|---|
expectation | object |
go_forward
Navigate forward in browser history
| Parameter | Type | Description |
|---|---|---|
expectation | object |
refresh_page
Refresh the current page
| Parameter | Type | Description |
|---|---|---|
expectation | object |
scroll_page
Scroll the page in a direction by a pixel amount, or scroll a specific element into view using a CSS selector.
| Parameter | Type | Description |
|---|---|---|
amount | number | |
direction | string | |
expectation | object | |
selector | string |
capture_page
Capture the current page state including all interactive elements. Returns a structured snapshot with element references (e1, e2, etc.) that can be used for interactions.
| Parameter | Type | Description |
|---|---|---|
expectation | object |
take_screenshot
Take a screenshot of the current page, viewport, full page, or specific element. Uses BiDi for full-page and element screenshots when available, falls back to classic API.
| Parameter | Type | Description |
|---|---|---|
expectation | object | |
filename | string | |
format | string | |
origin | string | |
quality | number | |
ref | string |
click_element
Click on an element using its reference from the page snapshot
| Parameter | Type | Description |
|---|---|---|
ref * | string | Element reference (e.g., e1, e2) from page snapshot |
expectation | object |
hover_element
Hover over an element using its reference from the page snapshot
| Parameter | Type | Description |
|---|---|---|
ref * | string | Element reference (e.g., e1, e2) from page snapshot |
expectation | object |
select_option
Select an option from a dropdown by value, text, or index: a native <select>, or a dropdown list (combobox / picklist such as Salesforce Lightning), which is opened and the option clicked
| Parameter | Type | Description |
|---|---|---|
ref * | string | Element reference for select element |
expectation | object | |
index | number | |
text | string | |
value | string |
drag_drop
Drag and drop from source element to target element
| Parameter | Type | Description |
|---|---|---|
sourceRef * | string | Source element reference from page snapshot (e.g. "e5") |
targetRef * | string | Target element reference from page snapshot (e.g. "e10") |
expectation | object |
teach_selector
Teach the system a preferred CSS selector for an element. The selector is saved and used as Phase 0 (highest priority) in future element discovery on this domain.
| Parameter | Type | Description |
|---|---|---|
css * | string | The preferred CSS selector for this element |
description * | string | Description of the element (e.g., "the NL language link", "the search button") |
expectation | object | |
scope | string |
input_text
Type text into an input field or textarea
| Parameter | Type | Description |
|---|---|---|
clear * | boolean | |
ref * | string | Element reference (e.g., e1, e2) for input field |
text * | string | Text to type into the field |
expectation | object |
key_press
Press a keyboard key, optionally with modifiers (ctrl, alt, shift, meta)
| Parameter | Type | Description |
|---|---|---|
key * | string | Key to press (e.g., "enter", "tab", "escape", "backspace", "up", "down") |
expectation | object | |
modifiers | array | |
ref | string |
file_upload
Upload a file through a file input element
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Path to file to upload |
ref * | string | File input element reference from page snapshot |
expectation | object |
mouse_move
Move mouse to specific coordinates
| Parameter | Type | Description |
|---|---|---|
x * | number | X coordinate |
y * | number | Y coordinate |
expectation | object |
mouse_click
Click on an element using mouse with specified button
| Parameter | Type | Description |
|---|---|---|
button * | string | |
ref * | string | Element reference from page snapshot |
expectation | object |
mouse_drag
Drag from one element to another
| Parameter | Type | Description |
|---|---|---|
fromRef * | string | Source element reference |
toRef * | string | Target element reference |
expectation | object |
tab_list
List all open browser tabs
| Parameter | Type | Description |
|---|---|---|
expectation | object |
tab_select
Switch to a specific browser tab by index
| Parameter | Type | Description |
|---|---|---|
tabId * | number | Tab ID to select (0-based index) |
expectation | object |
tab_new
Open a new browser tab
| Parameter | Type | Description |
|---|---|---|
expectation | object | |
url | string |
tab_close
Close a specific browser tab
| Parameter | Type | Description |
|---|---|---|
tabId * | number | Tab ID to close (0-based index) |
expectation | object |
verify_element_visible
Verify that an element is visible on the page
| Parameter | Type | Description |
|---|---|---|
ref * | string | Element reference from page snapshot |
timeout * | number | |
expectation | object |
verify_text_visible
Verify that specific text is visible on the page
| Parameter | Type | Description |
|---|---|---|
text * | string | Text content to verify is visible on the page |
timeout * | number | |
expectation | object |
verify_value
Verify that an element has the expected value or text content
| Parameter | Type | Description |
|---|---|---|
expectedValue * | string | Expected value of the element |
ref * | string | Element reference from page snapshot |
expectation | object |
verify_list_visible
Verify that multiple text items are visible on the page
| Parameter | Type | Description |
|---|---|---|
items * | array | List of text items that should be visible |
expectation | object |
wait_for
Wait for a condition to be met (element visible, URL contains, etc.)
| Parameter | Type | Description |
|---|---|---|
condition * | string | Condition to wait for |
timeout * | number | |
value * | string | Value for condition (element selector or text to match) |
expectation | object |
execute_javascript
Execute JavaScript code in the browser context. Use "return" to get a value back.
| Parameter | Type | Description |
|---|---|---|
script * | string | JavaScript code to execute in the browser |
args | array | |
expectation | object |
resize_window
Resize or move the browser window, use a device preset (mobile, tablet, desktop, desktop-hd), or change its state: fullscreen (whole screen and in front, ideal for demos and screen recordings), maximize, minimize (out of view, so the AI chat or another app is visible again), or normal (restore)
| Parameter | Type | Description |
|---|---|---|
expectation | object | |
height | number | |
preset | string | |
state | string | |
width | number | |
x | number | |
y | number |
dialog_handle
Handle browser dialogs (alert, confirm, prompt)
| Parameter | Type | Description |
|---|---|---|
action * | string | Dialog action: accept, dismiss, or get_text |
expectation | object | |
text | string |
console_logs
Get browser console logs or clear console. Uses BiDi event collector when available for cross-browser support, falls back to classic log API.
| Parameter | Type | Description |
|---|---|---|
action * | string | Console action: get_logs or clear |
level * | string | |
expectation | object |
network_monitor
Monitor network requests or control network state
| Parameter | Type | Description |
|---|---|---|
action * | string | Network action |
offline * | boolean | |
expectation | object |
pdf_generate
Generate a PDF from the current page. Uses BiDi printPage for cross-browser support (Chrome, Firefox, Edge), falls back to CDP.
| Parameter | Type | Description |
|---|---|---|
format * | string | |
landscape * | boolean | |
printBackground * | boolean | |
expectation | object | |
filePath | string | |
pageRanges | string | |
scale | number |
close_browser
Close the browser and end the session
| Parameter | Type | Description |
|---|---|---|
expectation | object |
reset_session
Reset the browser session (close and restart browser)
| Parameter | Type | Description |
|---|---|---|
expectation | object |
set_stealth_mode
Enable or disable stealth mode, which masks basic automation flags (navigator.webdriver, the "controlled by automated software" bar). Useful when testing your own site behind simple bot checks; it does not get past advanced bot protection such as Cloudflare challenges. If the browser is already running it will be restarted with the new setting.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | Enable (true) or disable (false) stealth mode |
expectation | object |
batch_execute
Execute multiple tool steps in a single round trip. Intermediate steps skip snapshots by default; the last step includes a snapshot. Max 20 steps. Cannot call batch_execute recursively.
| Parameter | Type | Description |
|---|---|---|
steps * | array | Array of tool steps to execute sequentially (max 20) |
stopOnFirstError * | boolean | |
expectation | object | |
globalExpectation | object |
get_selenium_docs
Read the current Selenium (or WebdriverIO) documentation as Markdown, from the projects' own llms.txt indexes. Use it before writing or fixing code with an API you are not sure of: an API that is not in the current docs or API reference does not exist (Selenium's guidance for AI agents). Without "page" it returns the docs index (https://www.selenium.dev/llms.txt); with a URL, path or topic it returns that page, with the code examples for every language. Only selenium.dev and webdriver.io are fetched; pages are cached for a day.
| Parameter | Type | Description |
|---|---|---|
expectation | object | |
framework | string | |
page | string |
agent_profile
Show or set the determinism profile: how much the agent may do on its own. explore (default) today's behaviour: plan review and Selenium's rules, nothing extra. guided a person approves intent: approved plans only, heals that change assertions or remove steps need the user's approval, tests need verify_test_stability (3 runs + fails-for-the-right-reason), audit log. strict CI-grade: no rule overrides, heals only change locators and waits, locked locators, 5 runs, a plan changed after approval blocks heals, the CI gate fails on anything unverified. Call it without argum…
| Parameter | Type | Description |
|---|---|---|
expectation | object | |
set | string | |
userRequest | string |
start_recording
Start recording browser actions to generate test scripts later
| Parameter | Type | Description |
|---|---|---|
expectation | object |
stop_recording
Stop recording browser actions. Returns full action log with element locators.
| Parameter | Type | Description |
|---|---|---|
expectation | object |
recording_status
Check if recording is active and show recorded actions
| Parameter | Type | Description |
|---|---|---|
expectation | object |
clear_recording
Clear all recorded browser actions
| Parameter | Type | Description |
|---|---|---|
expectation | object |
planner_setup_page
Start test planning: open the application, optionally run setup steps (e.g. a login) in the browser, and load the seed test that generated tests will follow. Call once, before other planner tools
| Parameter | Type | Description |
|---|---|---|
explorationDepth * | string | |
feature * | string | Name of the feature to create test plan for |
url * | string | URL of the web application to test |
expectation | object | |
seedTest | string | |
setupSteps | array |
planner_explore_page
Explore a page in detail: headings, input fields (with their labels, test ids and dropdown options), buttons, links and forms, as a compact inventory for writing test cases
| Parameter | Type | Description |
|---|---|---|
pageName * | string | Name of the page/section being explored |
expectation | object | |
pageUrl | string |
planner_save_plan
Save the test plan to specs/. Give it structured, as in Playwright: name, overview, suites (name, seedFile) with tests (name, target file) and steps (perform + expect per step); add the elements you found (name + locator) and any gaps. It is written as Markdown in a fixed layout. Free-form planContent is still accepted. Every saved plan is a draft ("Status: draft"): show it to the user and wait for their review. The generator refuses a draft plan; when the user approves it, call planner_approve_plan with their words.
| Parameter | Type | Description |
|---|---|---|
elements | array | |
expectation | object | |
filename | string | |
gaps | array | |
name | string | Title of the plan, e.g. "Shopping cart and checkout" |
outputDir | string | |
overview | string | What the application or feature does, in a few sentences |
planContent | string | |
suites | array |
planner_review_plan
Open a test plan as a review page in the user's browser: suites, tests, steps with their expected results, elements and gaps, with a comment box per test and Approve / Request changes buttons that write the decision into the plan. Without specFile it opens the overview of all plans in specs/ (review status, tests, generated test files, last run). Other Markdown in that folder is not a plan and is left alone. Read-only copies are saved in .selenium-ai-agent/review/ (ignored by git). Use it after planner_save_plan: ask the user to review the plan in the page, then call it again (or read the pla…
| Parameter | Type | Description |
|---|---|---|
expectation | object | |
open | boolean | |
specFile | string |
planner_approve_plan
Mark a reviewed test plan as approved, so the generator may write tests from it. Call it ONLY after the user has read the plan and explicitly approved it in the chat, and pass their words as "approval": never approve a plan yourself. The approval and the time are written into the plan. If the user asks for changes, save the changed plan with planner_save_plan (a draft again) and ask again.
| Parameter | Type | Description |
|---|---|---|
approval * | string | The user's own words approving the plan, quoted from the chat (e.g. "looks good, generate the tests") |
specFile * | string | The plan to approve: a path, or its name in specs/ (e.g. "shopping-cart.md") |
expectation | object |
generator_setup_page
Initialize the test generation session and navigate to the application. When the user names no language or framework, it uses the project's own: it looks at the build files (pom.xml / build.gradle → Java with JUnit 5 or TestNG; requirements.txt / pyproject.toml → Python with pytest or unittest; *.csproj → C# with NUnit, xUnit or MSTest; package.json → JavaScript/TypeScript; *.robot → Robot Framework) and reports what it found. Only in an empty project does it use the default, Python with pytest (selenium-python-pytest, tests/test_*.py); say so in one line. When the user asks for ano…
| Parameter | Type | Description |
|---|---|---|
testPlan * | string | Test plan content or path to test plan file. It must be approved by the user (Status: approved) |
url * | string | URL of the web application to test |
expectation | object | |
framework | string | |
projectRoot | string | |
reporting | string | |
skipPlanReview | boolean |
generator_read_log
Retrieve the log of all actions performed during test generation session
| Parameter | Type | Description |
|---|---|---|
expectation | object |
generator_write_test
Save generated test code to a file and update the .test-manifest.json. The manifest records everything the healer needs to run tests later: - framework, run command, config file, project root, base URL - list of all generated test files This means the healer can read the manifest and immediately know how to execute tests without the LLM having to re-analyze the project each time. The LLM can provide a custom runCommand, or let the tool suggest one based on the framework. Selenium tests are checked against Selenium's official rules for AI agents (https://www.selenium.dev/documentation/ai_ag…
| Parameter | Type | Description |
|---|---|---|
filename * | string | Filename for the test file |
testCode * | string | Generated test code |
allowRuleViolations | boolean | |
baseUrl | string | |
configFile | string | |
expectation | object | |
framework | string | |
outputDir | string | |
projectRoot | string | |
runCommand | object | |
scenario | string | |
skipPlanReview | boolean | |
specFile | string | |
verify | boolean |
generator_write_seed
Write a seed/bootstrap test (authentication, fixtures, environment setup). Seed tests are registered in the manifest under seedTests[] and are run before the main test suite by the healer. Use this for: - Login/auth flows that save cookies or tokens - Database seeding scripts - Environment validation checks
| Parameter | Type | Description |
|---|---|---|
description * | string | What this seed test does (e.g. "Login and save auth cookies") |
filename * | string | Filename for the seed test file |
framework * | string | Test framework |
testCode * | string | Seed test code (auth helper, fixture setup, etc.) |
expectation | object | |
outputDir | string | |
projectRoot | string |
generator_save_spec
Save a structured markdown spec to the specs directory. Specs capture test requirements in a human-readable format before generating test code. Saved to the plans folder (specs/ in the project, or SELENIUM_MCP_SPECS_DIR) as <title-slug>.md, a draft: show it to the user, and generate tests from it only after they approve it (planner_approve_plan).
| Parameter | Type | Description |
|---|---|---|
content * | string | Markdown spec content |
title * | string | Spec title (used as filename slug) |
expectation | object | |
outputDir | string |
generator_read_spec
Read a spec file from the specs directory. Tests are only generated from an approved plan: a plan that is still a draft (Status: draft) is refused until the user has reviewed and approved it (planner_approve_plan).
| Parameter | Type | Description |
|---|---|---|
specFile * | string | Spec or test plan to read: a path, or just its name in specs/ (e.g. "shopping-cart" or "shopping-cart.md") |
expectation | object | |
skipPlanReview | boolean |
selenium_rules_check
Scan existing tests for outdated or flaky patterns, before a migration or review: Selenium 3 APIs (find_element_by_*, findElementBy*, DesiredCapabilities, new WebDriverWait(driver, 10), TimeUnit timeouts), sleeps, implicit waits mixed with explicit ones, driver managers and driver paths, the old headless API, absolute XPath; Robot Framework Sleep / Set Selenium Speed; WebdriverIO browser.pause() and removed v10 APIs. It checks every Selenium / WebdriverIO file in Python, Java, C#, JavaScript/TypeScript, Ruby and Robot Framework against Selenium's official rules for AI agents (https://www.sele…
| Parameter | Type | Description |
|---|---|---|
path * | string | A test folder (scanned recursively; node_modules, .venv, target, build ... are skipped) or one test file |
expectation | object | |
framework | string |
healer_run_tests
Execute a test command and return stdout/stderr for failure analysis. Two modes: 1. **Explicit**: Provide command + args + cwd directly (LLM has full control) 2. **Manifest**: Provide just testPath — the tool reads .test-manifest.json (created by generator_write_test) to get the run command, project root, and framework automatically. Manifest mode example: { testPath: "/path/to/project/test/specs/tc07.spec.ts" } → Finds .test-manifest.json, reads runCommand, appends --spec testPath, runs it. Explicit mode examples: { command: "npx", args: ["wdio", "run", "wdio.conf.ts", "--spec",…
| Parameter | Type | Description |
|---|---|---|
timeout * | number | |
args | array | |
command | string | |
cwd | string | |
expectation | object | |
testPath | string |
healer_debug_test
Run a single test in debug/verbose mode and return detailed output. Same as healer_run_tests but returns more output (15KB stdout, 8KB stderr) for deeper analysis. Supports both explicit mode (command + args) and manifest mode (testPath only). See healer_run_tests for details on both modes.
| Parameter | Type | Description |
|---|---|---|
timeout * | number | |
args | array | |
command | string | |
cwd | string | |
expectation | object | |
testPath | string |
healer_fix_test
Apply a fix to a test file. Creates a .bak backup before overwriting. The LLM provides the corrected code. The fix is checked against Selenium's official rules for AI agents (https://www.selenium.dev/documentation/ai_agents/). Don't fix a flaky test with a sleep or a longer timeout: find the condition that was not yet true and wait for it. A fix with an error (a sleep, a wait timeout raised above the test's old maximum, a driver path, Selenium 3 APIs, ...) is not written. The active profile (agent_profile) sets the heal policy. Each fix is classified as locator, wait, assertion, removed / ad…
| Parameter | Type | Description |
|---|---|---|
fixDescription * | string | Description of what was fixed |
fixedCode * | string | The corrected test code |
testPath * | string | Absolute path to the test file to fix |
allowRuleViolations | boolean | |
expectation | object | |
framework | string | |
userApproval | string | |
verify | boolean |
verify_test_stability
Prove a test is deterministic before it counts as done: no LLM involved, only test runs. 1. Stability: runs the test N times in a row (the profile's stabilityRuns). One red run means the test is flaky (or failing): it is not accepted. 2. Fails for the right reason: copies of the test with one expected value changed (an assertion mutant each) must go red. A mutant that stays green shows an assertion that checks nothing. Skipped for Java and C# (use PIT / Stryker.NET). The result is stored in .test-manifest.json with the hash of the file: editing or healing the test makes it unverified agai…
| Parameter | Type | Description |
|---|---|---|
testPath * | string | Absolute path to the test file (it must be in .test-manifest.json: written with generator_write_test) |
timeout * | number | |
expectation | object | |
failCheck | boolean | |
runs | number |
browser_generate_locator
Generate a robust locator for an element described in plain words, e.g. "search box" or "the Add to Cart button of the Mechanical Keyboard". Matches text, label, placeholder, test id, element kind and the surrounding content; returns ready-to-paste locators for JavaScript, Python, Java, C# and Robot Framework. For elements in shadow DOM WebDriver cannot reach (Salesforce Lightning), the locators call a small helper file, returned once with the first such locator: save it next to the tests
| Parameter | Type | Description |
|---|---|---|
elementDescription * | string | Description of the element to find a locator for |
expectation | object |
healer_inspect_page
Inspect the current page and compare expected locators against actual elements. Use after a test failure to understand UI drift before applying a fix. Reports: - Found elements (locator still works) - Missing elements (locator broken, may need update) - Suggested updated locators based on element discovery
| Parameter | Type | Description |
|---|---|---|
locators * | array | Expected locators to validate against the live page |
expectation | object |
analyzer_setup
Initialize regression analysis session with product URL and business context
| Parameter | Type | Description |
|---|---|---|
productName * | string | Name of the product |
riskAppetite * | string | |
url * | string | Base URL of the product to analyze |
compliance | array | |
criticalFlows | array | |
expectation | object | |
outputDir | string |
analyzer_import_context
Import additional context from local files, inline text, or URLs to enrich the analysis
| Parameter | Type | Description |
|---|---|---|
contextType * | string | |
source * | string | File path, inline text content, or URL depending on sourceType |
sourceType * | string | Type of source: 'file' (local file), 'text' (inline text), 'url' (web page) |
description | string | |
expectation | object |
analyzer_scan_product
Explore the product using both process walking (from imported context) and page scanning
| Parameter | Type | Description |
|---|---|---|
maxPages * | number | |
scanDepth * | string | |
expectation | object | |
focusAreas | array |
analyzer_build_risk_profile
Build comprehensive risk profile from discovered features and context
| Parameter | Type | Description |
|---|---|---|
includePipelineConfig * | boolean | |
includeRecommendations * | boolean | |
expectation | object |
analyzer_save_profile
Save the completed risk profile to a file
| Parameter | Type | Description |
|---|---|---|
outputFormat * | string | |
expectation | object | |
filename | string | |
outputDir | string |
analyzer_generate_documentation
Generate a comprehensive product discovery document with screenshots - serves as input for the Planner agent
| Parameter | Type | Description |
|---|---|---|
includeRiskSummary * | boolean | |
includeScreenshots * | boolean | |
outputFormat * | string | |
expectation | object | |
outputFilename | string |