Both paths need an MCP-capable AI coding assistant. If you don’t have one yet, start with GitHub Copilot — there’s a free tier, no credit card required. See Run → Setup for the full install and sign-in walkthrough.
Instructions for Coding Agents
We recommend starting with our quickstart, then supplying your coding agent with our agent instructions file.TestDriver Agent Instructions
Copy the current version of our agent instructions to provide your coding agent with up-to-date instructions on how to generate TestDriver tests.
Explicit commands are preferred for production tests, as they are cheaper, faster, and more reliable.
Start a Conversation
With TestDriver’s MCP server and your AI assistant (GitHub Copilot, Cursor, or Claude Desktop), you can create tests by chatting with an AI agent. The agent spawns a virtual machine, executes actions, and writes test code for you. Open your AI assistant’s chat. If your project has no other agents configured, the TestDriver agent is used by default. Otherwise, select testdriver from the agent dropdown in the chat panel. Describe what you want to test:- Start a new session and spawn a Linux virtual machine
- Launch Chrome and navigate to your URL
- Execute actions based on your instructions
- Write the test code to a
.test.mjsfile
The TestDriver agent appears in the agent selection dropdown if you have other agents configured (like
copilot-instructions.md or other .agent.md files). Make sure to select testdriver to use TestDriver’s MCP tools.Live Preview Panel
When the agent starts a session, a live preview panel opens in your editor. This lets you:- Watch tests execute in real-time
- Interact with the VM — click, type, and navigate manually
- Debug issues — see exactly what the AI sees
The live preview panel requires the TestDriver VS Code extension. Set
TD_PREVIEW=ide in your MCP configuration to enable it. See the Run page for all device and preview options.Interactive Workflow
The recommended workflow for exploring and creating tests:Watch and Guide
The agent will start executing. Watch the preview panel and provide guidance if needed:
Example Conversation
Here’s a complete example of exploring and creating a login test:Generated Test Code
The agent generates standard Vitest test files:tests/login.test.mjs
Tips for Better Tests
Be specific with element descriptions
Be specific with element descriptions
Instead of “click the button”, say “click the blue Sign In button in the header”. More context helps the AI find the right element.
Add waits for dynamic content
Add waits for dynamic content
If your app has animations or loading states, tell the agent to wait:
Use assertions liberally
Use assertions liberally
Add assertions after each major action to catch regressions early:
Break complex flows into steps
Break complex flows into steps
For long workflows, create the test incrementally and verify each step works before moving on.
Next
Learn
Once the agent has explored your app, TestDriver caches what it discovers so your tests replay instantly without re-reasoning over the screen every time.

