# Testing

Every Spara agent has a built-in testing interface that lets you interact with a draft before it goes live. Testing always runs against your **current draft** — not the published version — so you can iterate freely without affecting real leads.

The testing interface is accessible in two places:

* **In the Agent Editor** — the right-hand panel, toggled alongside Ask Spara AI
* **On the** [Testing](/platform/testing.md) **page** — a standalone view for side-by-side comparison of multiple agents

<figure><img src="/files/3AKRZzrH9GYmbqQfkGcv" alt=""><figcaption><p>The Testing panel in the Agent Editor showing a simulated chat conversation.</p></figcaption></figure>

***

## Test interface by agent type

| Agent type | Test interface                                          |
| ---------- | ------------------------------------------------------- |
| Chat       | Simulated chat conversation in Navigator or Smartbar    |
| Voice      | Simulated phone call (browser-based)                    |
| Email      | Send a simulated incoming email, review the draft reply |
| Text       | Simulated SMS exchange                                  |

***

## Using the test interface

### Running a test

Open the right-hand panel in any Agent Editor and start interacting. For chat agents, type messages as if you're a lead. For voice agents, click to start a test call. The agent responds using your current draft instructions.

**Test conversations are isolated.** Messages sent during testing do not appear in lead history, trigger workflows, or generate analytics events.

### Reviewing a response

Each agent response can be inspected inline:

* **Lightbulb icon** — Explains why the agent responded the way it did, citing specific instructions it followed.
* **Thumbs down icon** — Flags the response as incorrect or unhelpful, and offers line-by-line suggestions for improving the prompt to prevent the issue.

Use these tools to understand model reasoning, especially when a response doesn't match your expectations.

### Resetting the test

Click the refresh or clear button to start a new test conversation. Each test session begins with a fresh lead context — no prior messages, no previously captured fields.

***

## Simulations

Simulations let you define automated test scenarios and run them in batch — a faster way to validate your agent against a set of known interactions without manually testing each one.

<figure><img src="/files/fwl0zjefimMHtQJtrjMj" alt=""><figcaption><p>The Simulations tab showing three passing simulations and a 100% pass rate.</p></figcaption></figure>

### Creating a simulation

Each simulation has two parts:

1. **Simulated user behavior** — A plain-language description of how the simulated lead should act. For example: "The lead is interested in enterprise pricing and wants to know if there's a volume discount."
2. **Success criteria** — A list of outcomes the agent must achieve for the simulation to pass. For example: "The agent asks for the lead's team size before providing pricing details."

Simulations can be as narrow (testing a single objection) or as broad (testing a full qualification flow) as you need.

### Running simulations

Simulations can be run individually from their detail view, or in batch from the Simulations list. Batch runs execute all simulations concurrently.

Each simulation run generates a **pass** or **fail** result. Failed simulations include an explanation of what went wrong and, where relevant, point to the specific instruction the agent didn't follow — or flag when the simulation's expected behavior conflicts with the agent's instructions.

### When to use simulations

Simulations are especially useful when:

* You've made a significant change to your instructions and want to verify it didn't break existing behavior
* You want to test edge cases (unusual questions, hostile leads, out-of-scope requests) without relying on live traffic
* You're onboarding and want confidence before going live

***

## FAQ

### Does testing affect my analytics or workflow triggers?

No. Test conversations are isolated from production. They don't create lead records, trigger workflows, or appear in analytics.

### Can I test with a specific lead's context?

Not directly from the editor. You can manually set fields at the top of the test panel (e.g., `first_name`, `company_name`) to simulate a personalized experience. For more advanced testing with realistic lead data, use [Simulations](#simulations).

### Can I run simulations against a published version?

Simulations always run against the current draft. If there's no draft, a copy of the published version is used as the starting point.

### How do I use Ask Spara AI during testing?

Toggle to [Ask Spara AI](/agents/agent-overview/ask-spara-ai.md) in the right-hand panel. It has access to the test conversation and can answer questions like "why did the agent respond this way?" or suggest prompt edits to fix a behavior you saw in testing.


---

# 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://docs.spara.com/agents/agent-overview/testing.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.
