Overview

Expressions let you inject dynamic values into step fields without writing full code. They are evaluated at runtime and can reference:
  • env.*: environment variables from your selected Environment
  • vars.*: test variables produced by earlier steps (e.g., Extract Text)
  • random.*: built‑in random data generators (email, name, uuid, etc.)
Use expressions inside double braces {{ ... }}. You can mix text with expressions, chain methods, and apply simple JavaScript. Expressions in step fields

When to use

  • Build URLs from environment values and previous step outputs
  • Fill forms with dynamic or random data
  • Verify text or URLs that contain variable parts
  • Drive conditional logic using values computed on the fly

Autocomplete and sources

In supported fields, typing {{ opens an autocomplete with tabs for Env, Vars, and Random. Select an item to insert it automatically. Autocomplete with Env/Vars/Random tabs
  • Env (env.*): Read‑only key‑values defined in the selected Environment
  • Vars (vars.*): Values saved by earlier steps in the same test case
  • Random (random.*): Utilities like email(), firstName(), uuid(), number(min,max)

Syntax

  • Wrap in braces: {{ ... }}
  • Mix with static text: Hello {{ vars.firstName }}!
  • Chain methods: {{ vars.email.trim().toLowerCase() }}
  • Build paths: {{ env.API_BASE }}/users/{{ vars.userId }}
  • Generate data: {{ random.email() }}

Common examples

  • URL from env and vars: {{ env.APP_URL }}/account/{{ vars.accountId }}
  • Normalizing a value: {{ vars.username.trim().toLowerCase() }}
  • Array operations: {{ env.TAGS.split(',').map(t => t.trim()) }}
  • Fallbacks: {{ vars.displayName || env.DEFAULT_NAME }}
  • Compose multiple parts: Hello {{ vars.firstName }} {{ vars.lastName }}!

Where it works

  • Navigate (URL)
  • Fill Text (value)
  • Verify Text / Verify URL (expected value)
  • Select Option (value)
  • Start Condition (expression)
  • Other fields that support text input in the editor

Best practices

  • Ensure the variable exists before use (the step that creates it must run earlier)
  • Keep expressions concise; move complex logic to a “Run JavaScript” step when needed
  • Do not attempt to assign to env.* (read‑only)
  • Prefer trim()/toLowerCase() for robust comparisons in verifications

How to use in Run JavaScript

In the Run JavaScript step you do not use {{ }}. The following are directly available:
  • env.* (read‑only)
  • vars.* (alias: testVars.*)
  • random.*
Use this step for multi‑line logic, loops, mappings, or to set new variables for later steps. Run JavaScript globals

Troubleshooting

  • Variable not found: confirm the producing step ran earlier and saved a variable
  • Quote handling: prefer {{ ... }} without additional quotes; the editor handles string composition
  • Curly braces: make sure both {{ and }} are present and balanced