Generate Random Number

You can generate random numbers or strings for a single or array variable. The Generate Random Number action allows you to initialize or populate variables for any purpose such as simulating an environment and testing an application program.

The Generate Random Number action is available from the Trigger window as follows:

Parameter description

The Generate Random Number pane provides these parameters:

Parameter Description
Data Type A list of logical internal data types are provided:

This is the data type that the random number generator algorithm uses to determine the range of values within which to generate the random data. When the data type is selected, the value in the Logical column on the Output tab changes accordingly. Parameters on the Generate Random Number pane also change to support String and Binary data types.
Count Indicates the number of values to return in the Output tab Value parameter. A value of 1 indicates a single value. A value greater than 1 indicates an array.
Minimum Value Indicates the minimum value that can be generated from the action.
Maximum Value Indicates the maximum value that can be generated from the action.
Length Used in conjunction with String and Binary data types. Specifies the maximum characters (for the string) or maximum number of bytes (for the binary buffer) that can be generated from the action.

Output tab

The Output tab is used to specify the destination of the randomized variable.

Parameter Description
Value The variable where the random number is returned.
This could be a scalar (single) variable or an array, as specified by the Count parameter.