‘Random String’ is a type of variable in NeoLoad to generate the text or string randomly. It is a simple type of string generator and its working is as same as ‘Random Integer‘. ‘Random String’ generates a letter or string of the given length range and helps to simulate the random string logic in the performance test script. e.g. abc, wrwe, osre etc. You can generate a string of a maximum length of 1000 using the ‘Random String’ variable type.
The very common use of ‘Random String’ is to input text while filling a form. Like First Name, Last Name, Address, Company etc.
Inputs of ‘Random String’ type variable
- Name: To provide the name of the variable to be used in the script. This is a mandatory input.
- Description: To describe the use of the variable. This is an optional input.
- Parameters: To configure the parameter setting:
- Minimum length: Specify the minimum value of the number range
- Maximum length: Specify the maximum value of the number range
- Predictable randomization: Checkmark this option to make the same sequence of the random string. This option helps to compare two identical tests.
- Value change policy: To define the setting when the next row (data) will be picked
- On each use (Default value)
- On each request
- On each page
- On each iteration
- For each Virtual User instance
Example
Consider, a personal detail submission form where a person needs to fill in his/her details. The form contains the following fields:
- First Name
- Last Name
- Company
- Address
Now, we have to parameterize all the above attributes and feed the random string. So, we will define 4 ‘Random String’ variables which are fName, lName, compName and address. These four variables will generate a random string and pass in the request. The ‘Value change policy’ is set to ‘on each iteration’. Refer to the below screenshot for a better understanding:

To use the variable, you have to write ${<variable name>} in the script.
Example: ${fName}, ${lName}, ${compName} and ${address}

Note: You can also validate the variable by using the ‘Test’ option. The variable should return the value of the defined length.

You may be interested: