Skip to main content
Variables allow you to store and reuse values throughout your test. They’re perfect for credentials, dynamic data, extracted values, and data-driven testing.

Overview

Variables in Revyl use the Mustache syntax: {{variableName}} When a test runs, Revyl replaces {{variableName}} with the actual value. Common use cases:
  • Login credentials ({{username}}, {{password}})
  • API tokens and keys
  • Dynamic data extracted during test execution
  • Environment-specific values (URLs, IDs)
  • Randomized test data

Accessing the Variables Panel

In the Test Editor, click the Variables tab at the top. Variables tab empty state The Variables panel shows:
  • Variables (count) - Number of variables defined
  • Reference with {{ name }} - Syntax reminder
  • Refresh button - Reload variable list
  • Add button - Create new variables

Creating Variables

Step 1: Open Variable Creation

Click the Add button or Create Variable in the empty state. Create variable form

Step 2: Fill Variable Details

  1. Variable name - Identifier (use lowercase, underscores, no spaces)
  2. Initial value (optional) - Default value for the variable
Naming best practices:
  • Use descriptive names: login_email, api_token, user_id
  • Avoid spaces: Use user_name not user name
  • Keep it short and memorable
Filled variable form

Step 3: Save

Click Add to create the variable. Variable created The variable is now available with the reference syntax: {{username}}

Managing Multiple Variables

You can create as many variables as needed for your test. Multiple variables Each variable displays:
  • Reference syntax - {{variableName}}
  • Current value - The stored value
  • Edit button (pencil icon) - Modify the variable
  • Delete button (trash icon) - Remove the variable

Using Variables in Test Steps

In AI Steps (Instruction, Validation, Extraction)

Simply type the variable reference in the instruction: Using variable in step Examples:
Type {{username}} in the email field
Click the button labeled {{button_name}}
Verify that {{expected_message}} is displayed
Enter {{credit_card}} in the payment field
Variables are highlighted in blue when recognized by the editor.

Extraction Steps and Variables

Extraction steps save data from the screen into variables during test execution.

Selecting a Variable for Extraction

  1. Add an Extraction step
  2. Enter what to extract: “Get the order confirmation number”
  3. Click the variable dropdown
Extraction variable dropdown The dropdown shows:
  • Existing variables - Select to overwrite
  • Create new variable - Define a new variable on-the-fly

Example Extraction Flow

Step 1: Extraction
Extract the confirmation code from the screen
Store in: {{confirmation_code}}
Step 2: Use Extracted Value
Type {{confirmation_code}} in the verification field
Verify that {{confirmation_code}} matches the expected format

Variable Behavior

Initial Values

Variables with initial values start with that value when the test begins. Use initial values for:
  • Static credentials
  • Default configuration
  • Fallback values

Runtime Updates

Variables can be updated during execution by:
  1. Extraction steps - Save screen data to variables
  2. Manual steps - Set variables via code execution (advanced)

Variable Scope

  • Variables are test-scoped - available throughout the entire test
  • All steps can read and use any variable
  • Variables persist across control flow (If/Else, While loops)
  • Variables reset to initial values on each new test run


Common Patterns

Login Flow

Variables:
  username: [email protected]
  password: SecurePass123!

Steps: 1. Type {{username}} in the email field
  2. Type {{password}} in the password field
  3. Click the Login button

Data Extraction and Reuse

Variables:
  order_id: (empty - will be extracted)

Steps: 1. Click "Create Order"
  2. Extract the order ID → {{order_id}}
  3. Navigate to order details page
  4. Type {{order_id}} in the search box
  5. Verify order {{order_id}} is displayed

Environment Configuration

Variables:
  base_url: https://staging.myapp.com
  api_key: sk_test_abc123

Steps: 1. Navigate to {{base_url}}
  2. Enter {{api_key}} in the API key field
  3. Click Connect

Next Steps


Need help? Contact [email protected]