1

Create a TestDriver Account

You will need a TestDriver Pro account ($20/month) to get an API key.

Sign Up for TestDriver

2

Set up your environment

Copy your API key from the TestDriver dashboard, and set it as an environment variable.
Export an environment variable on macOS or Linux systems
export TD_API_KEY="your_api_key_here"
Using VS Code, Cursor, or Windsurf? Try our VS Code Extension (beta).
3

Check out an example test

Download the TestDriver GitHub repository and run the example test.
git clone --depth 1 https://github.com/testdriverai/cli testdriverai
cd testdriverai/testdriver/acceptance
TestDriver tests are written in YAML, a human-readable data format. The prompt.yaml file contains an example series of steps for the agent to execute.
testdriver/acceptance/prompt.yaml
steps:
  - prompt: log in
  - prompt: add an item to the cart
  - prompt: click on the cart icon
  - prompt: complete checkout
Each step has a prompt that describes what the agent should do. The agent will use the prompt to generate commands that make the tests faster and more reliable the next time you run the test.
4

Generate regression test from prompts

Run the following command to run the test file. TestDriver will spawn a virtual machine, launch the sandbox test page, and execute the steps defined in the prompt.yaml file.
npx testdriverai@latest run prompt.yaml --write --heal
The --write flag tells TestDriver to save any generated commands to the test file, and the --heal flag allows TestDriver to recover from unexpected issues during the test run.
You can use an interactive CLI to generate test steps with the explore command
5

Run the generated regression test

After TestDriver has run the exploratory test, you’ll see that the prompt.yaml file has been updated with commands generated by the agent to make the test faster and more reliable.
  version: 6.0.0
  steps:
    - prompt: focus chrome
      commands:
        - command: focus-application
          name: Google Chrome
    - prompt: enter a username
      commands:
        - command: hover-text
          text: Username
          description: username input field
          action: click
        - command: type
          text: standard_user
    - prompt: enter a password
      commands:
        - command: hover-text
          text: Password
          description: password input field
          action: click
        - command: type
          text: secret_password
The --write command tells the agent to save the generated commands to the test file, and the --heal command gives the agent permission to recover if something goes wrong.