Store and Reuse Data Across Your Tests
Variables let you capture, store, and reuse information throughout your test flow. Perfect for handling dynamic data like order IDs, user credentials, or any values that change between test runs.Environment Variables
Set up global variables that work across all your tests. Head to your environment settings and define key-value pairs that your tests can access anywhere. Access them in any step using{{ VARIABLE_NAME }}
. They’re available everywhere—in click, type, assertions, JavaScript code, you name it.
Setting Variables On The Fly
From JavaScript Steps
Drop values into variables usingwindow.setVariable()
:
From Extract and Save Steps
When using AI Extract or other steps that return values, save the output directly to a variable. Just specify the variable name in the step settings—no code needed.
CHECKOUT_TOTAL
→ Use {{ CHECKOUT_TOTAL }}
anywhere.
Using Your Variables
Once set, variables work everywhere. In click, type, and other step types, use the template syntax{{ USERNAME }}
and it fills in the actual value. In assertions, check if something equals {{ ORDER_ID }}
. In JavaScript, use getVariable()
.
How Scope Works
Variables live at the test level—set them once, use them anywhere in that test run. Each test execution gets its own fresh set of variables, so parallel runs never interfere with each other. The flow is simple:- Test starts with environment variables loaded
- Steps can create or update variables as they run
- Later steps access any variables set earlier
- Test ends, variables reset for the next run