Introduction
Environment variables provide a centralized way to store values that can be shared across all tests in your project. They are managed through the Test Data section in your workspace.JSON values are supported and accessible in your tests as JSON objects.
Adding Environment Variables
1
Navigate to Test Data
Go to Test Data → Variables in your workspace.
2
Add variable
Click + Add Variable to create a new environment variable.
3
Set the scope
Select the environment for which this variable will be accessible.
Environment-level variables will be accessible to all tests. Use these to store API keys, base URLs, and common configuration values.
4
Configure its value
Enter the variable name and value. JSON values are supported and accessible in your tests as JSON objects.
5
Set the sensitivity
Toggle Sensitive to encrypt and hide the value after creation.
6
Save the variable
Save the variable to make it available across all of your tests.

Using Environment Variables
All variables (both environment and local) are accessed through the sameVARS object in your tests.
In Custom Code
UseVARS.<name> to reference any variable:
In Input Fields
When filling out text inputs, you can reference variables directly:
In AI Instructions
Variables are automatically available to Stably’s AI, so you can use them in prompts:- “Navigate to
VARS.baseUrl” - “Fill in the username with
VARS.testUsername”
Best Practices
| ✔️ Do | ❌ Avoid |
|---|---|
| Store secrets and API keys as Sensitive variables. | Hard-coding credentials directly in tests. |
Use descriptive, lower-camelCase names (apiKeyProduction). | Abbreviations that will be hard to remember (akp). |
| Create environment-specific variables for different staging environments. | Using the same credentials across all environments. |
| Use environment variables for values shared across multiple tests. | Creating duplicate variables with the same value. |