Use this file to discover all available pages before exploring further.
TestDriver makes it easy to write automated computer-use tests for web browsers, desktop apps, and more. Follow the directions below to run your first TestDriver test.
Join our Discord if you have any questions or need help getting started!
CLI
GitHub Copilot
Manual
Get started quickly with the TestDriver CLI.
1
Install TestDriver
Use npx to quickly set up an example project:
npx testdriverai init
This will walk you through creating a new project folder, installing dependencies, setting up your API key, and configuring MCP for your preferred AI assistant (VS Code, Cursor, Claude Desktop, etc.).
2
Run Your Test
TestDriver uses Vitest as the test runner. To run your test, use:
vitest run
This will spawn a sandbox, launch Chrome, and run the example test!
Use the TestDriver VS Code extension with GitHub Copilot for an AI-powered testing workflow.
Install TestDriver for VS Code
The extension provides one-click sign-in, project initialization, a live preview panel for watching tests execute, and MCP server configuration for GitHub Copilot.Once installed, follow the full setup guide to configure MCP and start building tests with AI assistance:
VS Code + Copilot Setup Guide
Sign in, initialize your project, and configure MCP for GitHub Copilot.
Install TestDriver and manually create the files yourself.
1
Create a TestDriver Account
You will need a TestDriver account to get an API key.
Get an API Key
Start with 60 free device minutes, no credit-card required!
2
Install Dependencies
Install Vitest and TestDriver as dev dependencies:
npm install --save-dev vitest testdriverai
3
Create a vitest.config.js File
In your project root, create a vitest.config.js file with the following content:
Add your API key to the example test file below and save it as test.mjs in your project root.
test.mjs
import { describe, expect, it } from "vitest";// Import TestDriver from the vitest hooksimport { TestDriver } from "testdriverai/vitest/hooks";describe("Google Search Example", () => { it("should search for TestDriver", async (context) => { // Create TestDriver instance - automatically connects to sandbox const testdriver = TestDriver(context, { apiKey: 'YOUR_API_KEY_HERE' // supply your API key here }); // Provision Chrome browser with a URL // This also starts dashcam recording automatically await testdriver.provision.chrome({ url: "https://duckduckgo.com" }); // Find and interact with elements using natural language const searchBox = await testdriver.find("DuckDuckGo search input field"); await searchBox.click(); // Type into the focused element await testdriver.type("testdriver.ai"); // Press Enter to search await testdriver.pressKeys(["enter"]); // Assert something is visible on the page const result = await testdriver.assert("search results are displayed"); expect(result).toBeTruthy(); });});
5
Run Your Test
TestDriver uses Vitest as the test runner. To run your test, use:
vitest run
This will spawn a sandbox, launch Chrome, and run the example test!