Variables

Variables allow you to pass dynamic data through your test cases — capturing values from one step and using them in a later step, parameterizing tests with external data, or keeping sensitive configuration out of your test logic.

Robonito supports four distinct variable systems, each suited for a different purpose.


Overview

TypeSyntaxScopeUse Case
Local Variable{{variableName}}Single test runCapture a value from one step and use it in the next
Global / Environment VariableSet by name in the Environment Variable stepWorkspace-wide per environmentShared config that changes between staging/production
Data Source Column{{@FileName.ColumnName}}Single test run, per rowParameterize tests with rows from a CSV, XLSX, or JSON file
Random Value{{$type}}Single test runGenerate realistic fake data inline (names, emails, UUIDs)

Local Variables

Local variables are created by the Local Variable node during a test run. They capture a value from a UI element — such as an order number, an ID returned from a form, or text displayed on screen — and store it under a name you define. That name becomes available to all subsequent steps in the same test run.

Creating a Local Variable

  1. During recording or in the node editor, add a Local Variable step.
  2. Target the element whose text you want to capture.
  3. Enter a Variable Name (no spaces; use camelCase or underscores).
  4. Optionally add a Slice Expression to extract a substring:
    • * — the entire text (default)
    • 0 — first character only
    • 1-3 — characters 1 through 3
    • 1-3,5,8-10 — characters 1–3, 5, and 8–10

Using a Local Variable

Type {{ in any smart input field and select the variable name from the autocomplete dropdown, or type the full expression manually: {{orderNumber}}.

Local variables are available to all steps that appear after the Local Variable node in execution order.

Local Variable node editor showing Variable Name, Slice Expression field, and targeted element


Global Variables (Environments)

Global variables — also called Environment Variables — are workspace-level key-value pairs stored inside a named Environment (e.g., Staging, Production). When you execute a test, you select which environment to use, and all global variables from that environment become available.

➡️ Learn more about Global Variables and Environments →


Data Source Variables

Data Source variables let you run the same test case against multiple rows of input data from an external file (CSV, XLSX, or JSON). Reference a column using {{@FileName.ColumnName}}.

For example, if you upload a file named users.csv with a email column:

{{@users.email}}

During execution, Robonito automatically picks a row and substitutes the value.

➡️ Learn more about Data Sources →


Random Values

Random value generators produce realistic fake data inline — without needing an external file. Use them in any smart input field with the {{$type}} syntax.

➡️ View all Random Value types →


Choosing the Right Variable

SituationUse
Capturing a value produced by the app (e.g., an order ID)Local Variable
Storing a base URL or API key that differs per environmentGlobal Variable
Running the same test with 10 different email addressesData Source
Filling a "First Name" field with a realistic fake valueRandom Value ({{$firstName}})
Referencing a captured value in the very next stepLocal Variable
Sharing a login token across test cases via Reusable TestLocal Variable (promoted to caller's scope)

Smart Input Fields

All fields that accept variable expressions show a smart input with autocomplete. Type {{ to open the variable picker:

  • {{name}} — selects from local variables captured earlier in the test
  • {{@file.col}} — selects from uploaded data source columns
  • {{$type}} — opens the random value generator picker
  • {{!name}} — used specifically in the Environment Variable node to reference a local variable as the source value (see Global Variables →)