NeoLoad – Constant String Variable

‘Constant String’ is a type of variable in NeoLoad to pass a defined text in the script. The purpose of the ‘Constant String’ variable is as same as defining a string variable in a coding language. Such type of constant string could be City Name, Company Name etc.

Inputs of ‘Constant String’ type variable

  1. Name: To provide the name of the variable to be used in the script. This is a mandatory input.
  2. Description: To describe the use of the variable. This is an optional input.
  3. Parameters: To define the value:
    1. Value: Provide a string that you want to pass in the script

Example

Consider, a personal detail submission form scenario where all the virtual users belong to the same company and country; need to fill in the following details in the form:

  1. Name
  2. Age
  3. Company Name
  4. Country Name

Now, we have to parameterize all the above attributes and feed the random string. So, we will define 1 ‘Random String’ variable for Name, 1 ‘Random Integer‘ variable for Age and 2 ‘Constant String’ variables for Company Name and Country Name. We are using ‘Constant String’ for company and country names because both are common for all the virtual user details. Refer to the below screenshot for a better understanding:

NeoLoad – Constant String Variable
Figure 01

To use the variable, you have to write ${<variable name>} in the script.

Example: ${companyName} and ${countryName}

NeoLoad – Constant String Variable - Script
Figure 02

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

NeoLoad – Constant String Variable - Test
Figure 03

You may be interested:


Leave a Comment