Random Variables
- Zuletzt aktualisiert2020/05/06
Random Variables
You can create two types of random variables: string and numerical.
Random variables are useful when you need to generate a random, repetitive string or numerical set. The values are generated when you run the task.
Common use cases:
- String: Generating test data as input for fields or forms
- Numerical: Generating ID numbers in batch
After you create the variable, you can use it by inserting the variable in several of the Workbench commands.
How to Create a Random Type Variable
Creating a Random String Variable
To create a random string variable, follow these steps:
- In the Workbench, click the Variable Manager icon at the top or on the tab on the right side.
- Click the Add button. The "Add Variable" window is displayed, with the "Create New Variable" option selected.
- Select type Random.
- Enter a name for the variable. The name must begin with an alphabetic character and cannot contain spaces.
- Select the Random String radio button. This is the default.
- Specify the string length in the field provided. The value cannot exceed 255.
- Click Save.
Creating a Random Numeric Variable
To create a random numeric variable, follow these steps:
- In the Workbench, click the Variable Manager icon at the top or on the tab on the right side.
- Click the Addbutton. The "Add Variable" window is displayed, with the "Create New Variable" option selected.
- Select type Random.
- Enter a name for the variable. The name must begin with an alphabetic character and cannot contain spaces.
- Select the Random Number - Rangeradio button.
- Specify the From and To values for the range.
- Click Save.