> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testdriver.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with TestDriver in minutes.

<Steps>
  <Step title="Create a TestDriver Account">
    You will need a [TestDriver Pro](https://app.testdriver.ai/team) account (\$20/month) to get an API key.

    <Card title="Sign Up for TestDriver" icon="user-plus" href="https://app.testdriver.ai/team" arrow horizontal />
  </Step>

  <Step title="Set up your environment">
    Copy your API key from [the TestDriver dashboard](https://app.testdriver.ai/team), and set it as an environment variable.

    <Tabs>
      <Tab title="macOS / Linux">
        ```bash Export an environment variable on macOS or Linux systems theme={null}
        export TD_API_KEY="your_api_key_here"
        ```
      </Tab>

      <Tab title="Windows">
        ```powershell Export an environment variable in PowerShell theme={null}
        setx TD_API_KEY "your_api_key_here"
        ```
      </Tab>
    </Tabs>

    <Tip>Using VS Code, Cursor, or Windsurf? [Try our VS Code Extension (beta)](/getting-started/vscode).</Tip>
  </Step>

  <Step title="Check out an example test">
    Download the TestDriver GitHub repository and run the example test.

    ```bash theme={null}
    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.

    ```yaml testdriver/acceptance/prompt.yaml theme={null}
    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](/commands/assert) that make the tests faster and more reliable the next time you run the test.
  </Step>

  <Step title="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.

    ```bash theme={null}
    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.

    <Tip>You can use an interactive CLI to generate test steps with the [explore command](/interactive/explore)</Tip>
  </Step>

  <Step title="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.

    ```yaml theme={null}
      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.
  </Step>

  <Step title="Managing your test suite">
    There's so much more you can do with TestDriver! Here are some popular features to explore:

    <Columns cols={2}>
      <Card title="Importing Tests" icon="table" href="/importing/csv">
        Generate tests from other formats like CSV, Gherkin, etc.
      </Card>

      <Card title="Self Healing" icon="bandage" href="/features/auto-healing">
        Automatically update tests when the application changes.
      </Card>

      <Card title="Variable Test Data" icon="square-root-variable" href="/guide/variables">
        Use variables run the same test with different data sets.
      </Card>

      <Card title="Reusable Snippets" icon="repeat" href="/features/reusable-snippets">
        Embed reusable snippets to simplify your test scripts.
      </Card>

      <Card title="Running Custom Code" icon="code" href="/guide/code">
        Use custom powershell or NodeJS code to extend the capabilities of your tests.
      </Card>

      <Card title="Setup & Teardown" icon="wrench" href="/guide/lifecycle">
        Systemically prepare the sandbox before running tests and clean up afterward.
      </Card>
    </Columns>
  </Step>
</Steps>
