Environment variables
All variables are stored on a global objectenv
that is accessible from any
step in your test. You can access these variables using the templating syntax
{{ env.VARIABLE_NAME }}
.
Reserved variables:
BASE_URL
: The base URL of the environment. This is automatically set when you create a new environment and can be used to construct URLs for your tests.CURRENT_URL
: The current URL of the page being tested. This is updated automatically as you navigate through your test.ENV_NAME
: The name of the environment. This is also automatically set when you create a new environment and can be used to identify the environment in your tests.TEST_NAME
: The name of the test. This is automatically set when you create a new test and can be used to identify the test in your tests.
.env
or JSON file.
Setting variables
setVariable
You can use JavaScript steps to set variables using the
setVariable
function.
USERNAME
variable to testuser
and the PASSWORD
variable
to a random string. You can then access these variables in other steps using the
templating syntax {{ env.USERNAME }}
or {{ env.PASSWORD }}
.
Save to environment variable
For steps that can have a return value such as AI extract or JavaScript, there’s an option on the step that allows you to input a string key to set on the environment. After this step is executed you will be able to access the variable using{{ env.NUM_BUTTONS }}
.

Accessing variables
Variables can be accessed using JavaScript. You can use it directly inside JavaScript steps or by using the templating syntax{{ }}
.
All input fields support the templating syntax.
For example, if you have set a variable named USERNAME
, you can access it like
this:

Module parameters
Module parameters are also variables. If you have a module parameter namedAPI_KEY
, you can access it using {{ env.API_KEY }}
.