# Use Parameters and Test Suites Well

Use run parameters for values that change between runs of the same world, keep fixtures with their scenario, and group scenarios into test suites by what they protect.

> Page: https://langwatch.ai/docs/agent-testing/best-practices/parameters-and-suites
> Source: https://github.com/langwatch/langwatch/blob/main/docs/agent-testing/best-practices/parameters-and-suites.mdx
> Index of all pages: https://langwatch.ai/docs/llms.txt

**Where we are in the story:** Anna's scenario has its criteria and its fixtures, and setup and teardown build and remove her world. Now we want more than one run of it: against two models, in two regions, and next to the other refund cases.

## A parameter changes a value, not the world

A run parameter is a value the run supplies, read by the scenario text as `{{ params.NAME }}` and by the agent under test. Use one for a value that can change while the world stays the same: the model, the region, the language of the conversation. One scenario then covers each value, and every result records which value it ran with.

Do not use a parameter to switch worlds. A `has_orders=false` flag that makes setup skip Anna's order turns one scenario into two with one set of criteria, and the criteria cannot be right for both. Write Anna with no orders as its own scenario, with its own fixtures.

## Fixtures are parameters keyed by entity type

Fixtures are run parameters too: one parameter per entity type, such as `customers` and `orders`, holding the scenario's entities as its default value. A [Scenario Connector](https://langwatch.ai/docs/agent-testing/scenario-connector#how-do-i-give-a-scenario-connector-test-data) reads them in `input["params"]`, and [setup and teardown hooks](https://langwatch.ai/docs/agent-testing/setup-and-teardown-hooks) read them in `run.fixtures` (`langwatch` SDK release after 2.5.0 / 2.0.1). LangWatch checks every `$ref` when the run starts and refuses a broken one with `scenario_parameter_fixture_invalid`.

Set fixtures in the scenario editor with **+ Fixture**, which offers the types the project's connectors declare, or with the scenario REST API: see [how fixtures are set](https://langwatch.ai/docs/agent-testing/scenario-connector#how-do-i-give-a-scenario-connector-test-data).

## Group scenarios into suites by what they protect

A test suite is a named group of scenarios you run together. Group by the behaviour a release must not break: a **Refunds** suite holds Anna with a delivered order, Anna with an order in transit, and a customer who asks for someone else's order. Run the suite before a release, and its pass rate is the refund behaviour's health.

In code, the same grouping is the `setId` (`set_id` in Python), so every run of a test joins one history. Give each scenario a stable `id` too, so renaming a test does not start a new history.

Also check: [Run parameters](https://langwatch.ai/docs/agent-testing/run-parameters), [Test suites](https://langwatch.ai/docs/agent-testing/test-suites), [Compare agents](https://langwatch.ai/docs/agent-testing/compare-agents).

Next: [Running and CI](https://langwatch.ai/docs/agent-testing/best-practices/running-and-ci), to run the suite often enough to trust it.

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.
