Parametrize your tests
Automated tests are easiest to maintain when you don’t hard‑code values that are likely to change. With variables, you can parameterize URLs, user accounts, and other inputs once and reuse them everywhere in a test - or override them when you run it. This lets you keep a single test working across environments and datasets without re‑recording anything.
Use variables for any value that might change
Any piece of data you type that isn’t completely static should be a variable:
- URLs / environment (staging vs production)
- Email addresses, usernames, phone numbers
- Passwords (and enable hiding the value to keep it safe from peeking co-workers)
- Product names, prices, dates
When you’re recording or editing a test, you can turn any piece of text (a URL, email, user name, etc.) into a variable by giving it a name and a default value. For example:
login_email→ default:[email protected]base_url→ default:https://staging.myapp.comusername→ default:john.aiva.test
AIVA will then automatically use that variable wherever it appears in the test steps. This gives you two big wins:
- Reuse inside the same test – Type the value once (e.g., fill the username box with the value
from
usernamewhen creating an account) and then assert it appears on the page (Check that the user profile contains the text fromusername). No copy-paste mistakes. - Run the same test with different data – The test works out of the box with the default values. In a batch (or when scheduling a run), you can override any variable for that run — change the environment, try a different user, or test with new data — and every step that uses the variable instantly picks up the new value.
Variables are defined per test, but when you run a batch you can override them by name across all tests at once. Change it in one place, and everything updates automatically. A test that doesn’t have a variable of that name simply ignores the override.
A variable exists only while at least one step of the test uses it. When you remove the last step that uses a variable, the variable is removed from the test too.
Change variable values for a single run
You can override the default values without editing the test:
- Run test with custom parameters — start one run with different values.
- Batches — override variables for every test in the batch, see Run test batches.
- REST API and CI/CD — pass the values when you start a run, see Run tests via the API.
All of these offer only the test’s own variables. A variable of a module the test uses is offered
only when the Run module step binds it to a test variable.
Variables in modules
A module has its own variables, separate from the variables of the tests that use it. A test variable
doesn’t reach a module just because the names match. For each module variable, the Run module step
chooses one of three ways to supply the value:
- Module default — use the module’s own default (the default for every new step).
- Fixed value — a constant stored on this step.
- Bind to a test variable — take the value from a test variable, which can be changed for each run.
See Module variables for when to use which.
A variable has to be the complete value of a typed or asserted field. Using a variable as
part of a larger piece of text (for example, Hello {username}) is not supported yet.
Wildcards and regular expressions in typed or asserted text are not supported yet either.