Skip to content
Dynamic & data-driven tests

Dynamic data and variables

Random values at every run, random dropdown options, and values saved in one step and reused in the next.

A recorded test repeats the values you typed. That breaks when the site doesn’t accept them twice — an email already registered, a coupon already used — and it always checks the same case. Dynamic data makes a test use different values at every run, and variables let a later step reuse a value only known at run time, like an order number.

Insert a dynamic value

  1. In the Action History, open the card of a typed field (or of an assertion) and click its value to edit it.
  2. Click the { } button next to the value. A menu lists the generators, each with an example, plus your saved variables, test data columns and secrets.
  3. Pick one. It is written into the value as a {{…}} code, e.g. {{email}}.

To randomize only part of a value, select that part first: with “mario” selected in mario@test.it, picking random text turns it into {{random:5}}@test.it (random text, letters and digits take the length of the selection). You can also type the codes by hand.

The card shows an e.g. preview of a possible value and a dynamic badge (dice icon). A ⚠ warns about a code that is not recognized — a typo, or a variable that is not saved by an earlier step; it then stays as plain text. The values actually used at each run appear in the Runner output.

Available generators

GroupCodeProduces
Random{{random:N}}N random letters and digits, e.g. k3x9a2.
{{letters:N}} / {{digits:N}}N random letters / N random digits.
{{number:1-100}}A random number in the range.
{{uuid}} / {{timestamp}}A unique id / the current time as a number.
Date{{date}}Today, e.g. 2026-10-01.
{{date:+7}} / {{date:-1}}Today plus or minus N days.
{{date:+7:dd/mm/yyyy}}The same, in the format you choose.
Person{{firstName}} {{lastName}} {{fullName}}A random name.
{{email}} / {{phone}}A random email (e.g. giulia.rossi4821@example.com) / phone number.
Address{{street}} {{city}} {{zip}}A random street, city, postal code.
Italy{{fiscalCode}} / {{iban}}A codice fiscale and an Italian IBAN with valid check characters, accepted by form validation.
Saved{{name}}A variable saved by an earlier step.
Test data{{data:column}}The value of that column in the current data row.
Secrets{{secret:name}}A secret of the active environment.

On the card of a dropdown step, Option chooses which entry the test selects: Fixed (the one you recorded, default), Random, First or Last. Disabled options, empty ones and placeholders such as -- Select -- or Choose… are skipped. The Runner output shows the option picked, e.g. [dynamic] random option: Italy.

For a random item of a list of cards or rows — not a dropdown — see Repeating lists.

Variables: save a value, reuse it later

Three ways to save a value under a name:

  • Typed field — on the card, save the value that was typed (useful when it is random: register with a random email, then log in with the same one).
  • Dropdown — save the visible text of the option chosen (useful with a random option).
  • Text on the page — while recording, click Assert, click the element (an order number, a total…) and choose Variables → Save text as variable. On its card, pick Visible text or Input value and the name.

Then write {{name}} in any later step — a typed value, an assertion — on its own or inside other text. The card of the saving step shows → {{name}}. A saved variable wins over a generator with the same name: after saving a value as email, {{email}} means that value, not a new random one.

Names use letters, digits and _ and can’t start with a digit. JavaScript keywords and a few names used by the generated code (such as page, context, item, row, testData, or names starting with qa or _) are not allowed.

Checking a format instead of exact text

When a value changes at every run, check its format with a regular expression — the .* button on an assertion card. See Checking a format.

In Page Objects

Dynamic values work in Page Object methods too. Variables saved inside a method are available only within that method. To method keeps a typed value that contains a dynamic code as it is, instead of turning it into a parameter.

Dynamic data & variables — Actify Studio Docs