Date variable

NeoLoad – Date variable

NeoLoad’s “Date” type variable creates the date and time in the chosen format for use in scripts. Depending on the needs of the script, you can set a pattern for the date or time. To ensure that different values can be specified in the request for different virtual users, NeoLoad provides the ability to increment the date or time value in intervals of one second, millisecond, minute, hour, day, month, and year.

The ‘Date’ variable type is specifically used to enter personal information such as birth dates, product purchase dates, card expiration dates, etc.

Variable input of type ‘Date’

  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: to specify the meaning and pattern
    1. Date Pattern: To specify the pattern of the value, use a format such as dd/MM/yyyy HH:mm: ss. You have the option of creating a custom pattern or choosing from a drop-down list of predefined options.
    2. Start time or date: specify the start time or date. The date can also be selected using a calendar.
    3. Increased value: If you pass 0 instead of the range value, the value remains the same. The day or period will be on:
      • Millisecond
      • Second (default)
      • Minute
      • Hours
      • Day
      • Month
      • Year
  4. Value change Policy: specify the settings to choose the next date and time
    • On each use (Default value)
    • On each request
    • On each page
    • On each iteration
    • For each Virtual User instance
  5. Variable Value Distribution Policy: To define the scope and framework of the variable’s distribution
    1. Scope: The available values are
      • Local
      • Global (Default Value)
      • Unique

Example

Consider the following scenario: All virtual users must fill out a form with personal information, including the following information:

  • Name
  • Date of birth
  •  credit card number
  • Credit card expiration date

All of the above attributes now need to be parameterized. So, we create a random string variable for the name, a random integer variable for the credit card number, and two date type variables for the birth date and credit card expiration date. Note that the date format for both variables, dd/MM/yyyy for the date of birth and MM/yy, will be different. Please refer to the following screenshot for clarification:

NeoLoad – Date Variable

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

For example $DoB and $ccExpireDate

NeoLoad – Date Variable - Script

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

NeoLoad – Date Variable - Test
Scroll to Top