Skip to main content
Variables are project-level placeholders that you can reference in checkpoint goals, instructions, and verification assertions. They let you write a scenario once and run it with different configurations — different URLs, usernames, bet amounts, or any other value that might change between runs.

How Variables Work

  1. Define a variable at the project level with a key and an optional default value
  2. Reference it in your scenarios using the $VAR_NAME syntax
  3. Override the value (or use the default) when starting a run
At runtime, Duzz substitutes every $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.
Variables are project-scoped — they’re available across all scenarios in the project.

Using Variables in Scenarios

Reference a variable anywhere in a checkpoint goal, instruction, or verification assertion by prefixing its key with $:
FieldExample
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”
When the run starts, Duzz scans for all $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
This means you can run the same scenario against different environments or configurations without editing the scenario itself:
VariableDefaultRun A overrideRun B override
$API_URLhttps://staging.app.com(use default)https://prod.app.com
$USERNAMEtestuseradmintestuser
$BET_AMOUNT100500100

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

ConceptWhat it is
VariableA 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 valueUsed when no override is provided at run time
OverrideA per-run value that replaces the default