Random
Generate a fake name, email, number or other value and store it in a variable.
In both apps
WarpX Browser
WarpX 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.
Settings
- Command
The FakerJS command, such as
faker.internet.email()orfaker.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
- Start
- Open URL
- Random
- Type text
- Click element
- Add Random before the form steps.
- Type
faker.person.firstName()in Command and click Test to check it. - Type
firstNamein Output variable. - 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 olderfaker.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.