> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# Set up your test environment

> Set up an environment for Doc Detective tests.

You can use Doc Detective directly against your production site. For testing, it's often useful to set up a local HTML server to run your tests against. The tutorials that follow fill in a sample intake form, so you need to serve that form locally before you run them.

The sample test specs themselves are hosted online, so you don't need to download them. You pass each one to Doc Detective by URL with the `--input` argument, as shown in the following tutorials.

1. Download the sample intake form, [watson\_and\_holmes\_intake\_form.html](https://raw.githubusercontent.com/doc-detective/doc-detective/main/docs/examples/watson-and-holmes/watson_and_holmes_intake_form.html), into an empty folder. The file is self-contained, so it's the only file you need.

   ```shell
   curl -O https://raw.githubusercontent.com/doc-detective/doc-detective/main/docs/examples/watson-and-holmes/watson_and_holmes_intake_form.html
   ```

2. In a terminal, navigate to the folder that contains the form:

   ```shell
   cd <path-to-form-folder>
   ```

   Replace `<path-to-form-folder>` with the actual path to the folder where you saved the form.

3. Install and run a webserver. Running your tests against a local server allows you to make edits and see them in real time. Also, you need to serve the files in a web browser to experiment with video recording and other features.

   Any web server works, but here are a few options (unassociated with Doc Detective):

   #### Python

   To run a local server with Python, you can use the built-in `http.server` module:

   ```bash
   python -m http.server 8080
   ```

   #### Node.js

   To run a local server with Node.js, you can use the `http-server` package:

   ```bash
   npx http-server -p 8080
   ```

   #### VSCode

   In VSCode, search for and install the [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) extension. It gives you a local development server with live reload capability.

   > **Info**
   >
   > To match the Doc Detective tutorials, set the port number to `8080` in your VSCode settings.

   Once the server is started, you can open a browser window to `http://localhost:8080/watson_and_holmes_intake_form.html`. If you see the rendered intake form, you're ready to start testing.