Start a Conversation
Open GitHub Copilot Chat in VS Code. 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 VS Code. 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 device configuration docs for all preview options.Interactive Workflow
The recommended workflow for 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 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.

