Quickstart
Get started with TestDriver in minutes.
TestDriver isn’t just a computer-use agent, it’s an entire AI-native workflow for creating end-to-end tests. Follow these steps to set up your environment and get started with TestDriver.
Set Up TestDriver
In your project directory, run the interactive setup process:
This will prompt you to set up your test runner: a target computer to run tests on. You can use either a hosted sandbox or your own computer.
- Hosted Runners - Run tests in a ephemeral linux virtual machine. Recommended for ease of use, added privacy, and parallelization. Requires a TestDriver API key.
- Local Runner - Run tests on your own computer. Recommended for working with existing user sessions, files, and applications. Requires additional setup.
During init
, choose “yes” for the sandbox option. This will prompt you for your API key:
This will write the TD_VM=true
and TD_API_KEY
values to .env
file in your project directory.
During init
, choose “yes” for the sandbox option. This will prompt you for your API key:
This will write the TD_VM=true
and TD_API_KEY
values to .env
file in your project directory.
Using your own computer as a test runner requires additional prerequisites. Follow the AccordionGroup below to set up your local environment.
Install Python & Visual Studio Build Tools
Install NodeJS
You will also need NodeJS if you don’t have it yet.
Set Execution Policy
Open a new terminal with admin privileges and execute the following command :
This gives TestDriver the right to execute it’s scripts and is only valid for the current user.
Using your own computer as a test runner requires additional permissions. Follow the steps below to set up your local environment.
Enable Screen Recording Permissions
TestDriver requires screen recording permissions to capture your screen during test execution.
- Open System Preferences > Security & Privacy > Privacy > Screen Recording.
- Check the box next to your terminal application (e.g., Terminal, iTerm2) to allow screen recording.
This is required for TestDriver to capture your screen during test execution.
Enable Accessibility Permissions
- Open System Preferences > Security & Privacy > Privacy > Accessibility.
- Check the box next to your terminal application (e.g., Terminal, iTerm2) to allow accessibility features.
This is required for TestDriver to interact with your applications during test execution.
Create your first test
Use the /explore
command to supply test steps to the TestDriver agent. TestDriver will look at the screen and generate a test steps based on your input.
TestDriver will generate and run test steps. See the YAML Reference.
Test steps are saved in the current working YAML file.
Use Control + C in the CLI or the square “stop” button in the extension to stop test execution.
Running tests
Once saved, you can run your test file anytime. Click the “Run” button in the extension or use the CLI command:
Running tests is about twice as fast as creating them, as the AI doesn’t need to interpret your input.
Generate self-driving tests
TestDriver can also generate tests without any input! Instead, it will suggest test steps based on what it sees on the screen.
Self-Driving Test Guide
Unleash TestDriver’s full potential by letting it create tests for you.
Deploy to CI/CD
The testdriverai init
command automatically sets up a GitHub Action workflow for you. Any test files found in the testdriver
directory will run on every push to the main branch.
GitHub Actions
Learn how to set up GitHub Actions for TestDriver.