# Running Tests

Running tests is essential of course. There are many ways to run your tests, we will see the basics here, and you can check out our [Running Tests](/getting-started/running-tests.md) section in our in-depth guide.

### TestBox CLI

The easiest way to run your tests is to use the TestBox CLI via the `testbox run` command. Ensure you are in the web root of your project or have configured the `box.json` to include the TestBox runner in it as shown below. If not CommandBox will try to run by convention your site + `test/runner.cfm` for you.

<figure><img src="/files/3n10Akxaqbu8YmmIUf0H" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can also pass the runner URL via the `testbox run` command. Try out the `testbox run help` command.
{% endhint %}

Here is a simple `box.json` config that has a runner and some watcher config.

```json
"testbox":{
    "runner":"http://localhost:49616/tests/runner.cfm",
    "watchers":[
        "system/**.cfc",
        "tests/**.cfc"
    ],
    "watchDelay":"250"
}
```

{% hint style="info" %}
Check out the watcher command: `testbox watch`
{% endhint %}

### URL Runner

Every test harness also has an HTML runner you can execute. By convention the URL is

```
http://localhost{port}/tests/runner.cfm
```

This will execute ALL tests in the `tests/specs` directory for you.

### URL Spec Runner

You can also target a specific spec to execute via the URL

```
http://localhost{port}/tests/specs/MySpec.cfc
```

## Global Runner

TestBox ships with a global runner that can run pretty much anything. You can customize it or place it wherever you need it:

![](https://raw.githubusercontent.com/ortus-docs/testbox-docs/master/.gitbook/assets/testbox-global-runner.png)

## Test Browser

TestBox ships with a test browser that is highly configurable to whatever URL-accessible path you want. It will then show you a test browser where you can navigate and execute not only individual tests but also directory suites.

![](https://raw.githubusercontent.com/ortus-docs/testbox-docs/master/.gitbook/assets/testbox-browser.png)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://testbox.ortusbooks.com/getting-started/testbox-bdd-primer/running-tests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
