Random  string

Random  string variable using NeoLoad

NeoLoad uses a type of variable called “Random String” to randomly generate text or strings. It’s a simple type of string generator and works similarly to a “random integer”. The “Random String” function in the performance test script creates a letter or string of the specified length range to replicate the random string logic, such as “ABC”, “we”, “sore”, etc. The “Random String” variable type makes strings that can be 1000 characters long.

The arbitrary string is most commonly used to enter text when filling out forms. such as names and surnames, addresses, companies, etc.

Input for variables of type ‘Random String’

  1. Name: specify the name of the variable to be used in the script. This entry is required.
  2. Description: 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

Example

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

  • Name
  • Last name
  • Organization
  • Address

Now all of the above attributes must be parameterized and an arbitrary string must be specified. As a result, we will define the variables fName, lName, compName, and address as 4 “arbitrary string” variables. The request comes along with a random string produced by these four variables. At each cycle, it is selected as the “Value Change Policy” setting. Please refer to the following screenshot for clarification:

Screenshot (219).png

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

For example, $fName, $lName, $compName, and $address

NeoLoad – Random String Variable - Request

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

NeoLoad – Random String Variable - Test
Scroll to Top