How Variables Work
- Define a variable at the project level with a key and an optional default value
- Reference it in your scenarios using the
$VAR_NAMEsyntax - Override the value (or use the default) when starting a run
$VAR_NAME reference with the resolved value before the agent sees the checkpoints. The agent receives the final text with all variables replaced.
Defining Variables
Navigate to your project’s Variables page to create and manage variables. Each variable has:- Key — Must be uppercase letters, digits, and underscores, starting with a letter (e.g.,
API_URL,BET_AMOUNT,TEST_USERNAME). The format is[A-Z][A-Z0-9_]*. - Default value — Optional. Used when no override is provided for a run. If left blank, the variable must be overridden at run time.
Using Variables in Scenarios
Reference a variable anywhere in a checkpoint goal, instruction, or verification assertion by prefixing its key with$:
| Field | Example |
|---|---|
| Goal | ”Navigate to $APP_URL and log in” |
| Instructions | ”Enter $USERNAME in the email field and $PASSWORD in the password field” |
| Assertion | ”The balance shows $EXPECTED_BALANCE coins” |
$VAR_NAME references and replaces them with resolved values.
Overriding Per Run
When you start a run, Duzz detects which variables the selected scenario references and shows them in the run configuration form. For each variable you can:- Leave it blank — The project default is used
- Enter a value — Your override is used for this run only
| Variable | Default | Run A override | Run B override |
|---|---|---|---|
$API_URL | https://staging.app.com | (use default) | https://prod.app.com |
$USERNAME | testuser | admin | testuser |
$BET_AMOUNT | 100 | 500 | 100 |
Variables in Suites
Suite items can each have their own variable overrides. This lets you run the same scenario across multiple configurations in a single suite execution — for example, testing the same flow against staging and production by varying$API_URL per suite item.
Quick Reference
| Concept | What it is |
|---|---|
| Variable | A project-level placeholder with a key and optional default |
| Key format | [A-Z][A-Z0-9_]* — uppercase, underscores, digits |
| Syntax | $VAR_NAME in goals, instructions, or assertions |
| Default value | Used when no override is provided at run time |
| Override | A per-run value that replaces the default |