Constant string

Constant string variable for NeoLoad

NeoLoad uses the “Constant String” variable type to provide predefined text to the script. The ‘Constant String’ variable serves the same purpose as creating a string variable in a programming language. City name, company name, and other consistent strings fall into this category.

Variable input of type ‘Constant 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: Definition of the value
    • Value: Give the script a string to pass.

Example

Imagine filling out a personal information form where all virtual users are from the same company and country and must provide the following information:

  • Name
  • Age
  • Company
  • Country

Now all of the above attributes must be parameterized and an arbitrary string must be specified. For Name, Age, and Company Name, we declare 1 “Random String” variable, 1 “Random Integer” and 2 “Constant String” variables. Since company and nation names are used in all virtual user data, we use ‘Constant String’ for these names. Please refer to the following screenshot for clarification:

Screenshot (222).png

Figure 01

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

For example, $companyName and $countryName

NeoLoad – Constant String Variable - Script

Figure 02

Note: The ‘Test’ option also allows you to confirm the value of the variable. The variable should return the correct result.

Figure 03

Scroll to Top