Skip to content

Variables Overview & Resolution Order

RouteCase features a multi-tiered variable system supporting environment variables, chained response values, and dynamic test data generators.


RouteCase uses curly brace syntax:

  • Double Curly Braces {{VARIABLE}}: Replaced by RouteCase’s variable expansion engine (environment variables, captured values, or dynamic generators).
  • Single Curly Braces {id}: Used exclusively in endpoint path templates to define path parameter placeholders (substituted from params: { "id": "val" }).

When evaluating a {{...}} variable expression, RouteCase resolves values in strict order:

Priority 1 Captured Runtime Variables (capture)
Highest Precedence
Priority 2 Workspace Environment Files (.rcase.env, .rcase.env.json)
Precedence 2
Priority 3 VS Code Workspace Settings (routecase.env)
Precedence 3
Priority 4 Dynamic Built-in Generators ({{$uuid}}, {{$isoDate}}, {{$randomEmail}})
Fallback Precedence
  1. Captured Variables (capture): If an earlier test case extracted a token named authToken, {{authToken}} will take top priority.
  2. Environment Files (.rcase.env / .rcase.env.json): Workspace environment files are evaluated next.
  3. VS Code Settings (routecase.env): Configuration defined in workspace settings.
  4. Dynamic Generators ({{$...}}): Variables beginning with a dollar sign $ are evaluated by the built-in generator engine.

Variables can be placed in any of the following fields:

  • Root baseUrl
  • Root, endpoint, and case headers
  • Path template params
  • URL query parameters
  • Request body (inside string values, object keys, or nested arrays)