Random integer variable

Random integer variable: NeoLoad

NeoLoad uses a type of variable called “Random Integer” to produce random integers. It is a basic type of number generator that works within the default range and helps simulate random number logic in the performance test script. for example, 10, 155, 26, 30, etc.

Random Integer is most commonly used to enter a number when filling out a form. such as age (range: 18 to 60), weight (range: 40 to 120), height (range: 50 to 250), etc.

Variable input of type ‘Random Integer’

  1. Name: specify the name of the variable to be used in the script. This entry is required.
  2. Description: To explain the function of the variable. This entry is not required.
  3. Parameters: Configuration of parameter settings
    • Minimum Value: Sets the minimum value of the range of numbers.
    • Max Value: Specify the maximum value of the numeric range.
    • Probabilistic randomization: To create the same sequence of random numbers, select this option and check the box. This option allows you to compare two identical tests.
  4. Value change strategy: to specify the time to select the next row (with data),
    • On each use (Default value)
    • On each request
    • On each page
    • On each iteration
    • For each Virtual User instance any use (default setting)

Example

Consider a personal information submission form that requires a person to provide their information. The following fields are on the form:

  • Name
  • Age
  • PIN code

The ‘Random String’ variable type can be used to parameterize the person’s name, while ‘Random Integer’ is the ideal choice for ‘Age’ and ‘PIN Code’. Assign the names “age” and “PIN code” to any two integers you create. At each cycle it is selected as the “Value Change Policy” setting. Please refer to the following screenshot for clarification:

NeoLoad - Random Integer Variable

You must enter the variable name as $ in the script to use it.

For example: $age and $pinCode

NeoLoad - Random Integer Variable - Script

Note: The ‘Test’ option can also be used to validate the variable. The variable must return a value within the specified range.

NeoLoad - Random Integer Variable - Test
Scroll to Top