---
title: "Running Tests with TestDriver"
sidebarTitle: "Running Tests"
description: "Execute regression test files for debugging and validation."
icon: "play"
---

Run tests using previously created test scripts. This command replays the steps defined in the YAML file, performing each action sequentially.

You can run a test script by specifying the file path in the terminal or interactively within the TestDriver CLI.

### Example in terminal

```bash
npx testdriverai@latest run path/to/test.yaml
```

This will execute the test script located at `path/to/test.yaml`. If the test passes, the command will exit with a status code of `0`. If it fails, the command will exit with a status code of `1`.

<Note>
  The path to the test file provided should be relative to the current working
  directory.
</Note>

### Interactive mode

To run a test interactively:

1. Launch the TestDriver CLI:

```bash
npx testdriverai@latest edit
```

2. At the `>` prompt, type:

```bash
> /run path/to/test.yaml
```

## Notes

- Ensure the YAML file is valid and follows the TestDriver specification.
- The default file path is `testdriver/testdriver.yaml` if no file is specified.

<Card title="Running Tests in CI" icon="link" href="/getting-started/ci">
  Run tests with Hosted Runnings in GitHub Actions
</Card>
