Block reference / Data

Random

Generate a fake name, email, number or other value and store it in a variable.

In both appsWarpX BrowserWarpX Phone

Random runs a command from the FakerJS library and stores the result. Use it to fill sign-up forms with believable test data, or to pick a random number. The command is a short expression that starts with faker.

The Random block's settings, filled in as in the example below.

Settings

Command

The FakerJS command, such as faker.internet.email() or faker.number.int({ min: 18, max: 60 }). Click Test to see a result without running the workflow. References such as {{variables.max}} are filled in first.

Examplefaker.person.firstName()
Output variable

The variable that receives the value. It starts as random. Leave it empty to only pass the value on.

ExamplefirstName

Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.

What it hands on

Sets the output variable and hands the value on as {{prevBlockData}}.

Example: Fill a sign-up form with a random first name

  1. Start
  2. Open URL
  3. Random
  4. Type text
  5. Click element
Where Random sits in the example workflow.
  1. Add Random before the form steps.
  2. Type faker.person.firstName() in Command and click Test to check it.
  3. Type firstName in Output variable.
  4. In the Type text block for the name field, type {{variables.firstName}}.

Good to know

  • The command is the current FakerJS API: faker.person.firstName(), not the older faker.name.firstName(). The Test button shows the error if a command does not exist.
  • A command that fails stops the block with Invalid FakerJS command: and the reason.
  • For a quick random number, {{$randint(18, 60)}} works without a block in any field that takes references.

See also

  • Insert data — Set variables and add values to the workflow's table, several at once.
  • Forms — Fill a text field, choose a dropdown option, or tick a checkbox or radio button.
  • Type text — Put text into an input, textarea or editable element.