NeoLoad – Date Variable

‘Date’ is a type of variable in NeoLoad to generate date and time in the desired format in the script. You can define a pattern of the date or time as per the script requirement. NeoLoad provides an option to increment the date or time value by an interval of a second, millisecond, minute, hour, day, month and year so that different values can also be passed in the request for different virtual users.

The specific use of the ‘Date’ variable type is to input the personal data like date of birth, date of purchase of the product, card expiry date etc.

Inputs of ‘Date’ 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 and pattern
    1. Date pattern: To define the pattern of the value e.g. dd/MM/yyyy HH:mm:ss. Either you can select the pre-defined from the drop-down list or write custom pattern.
    2. Starting date: To define the starting date or time. You can also use calender to select the date.
    3. Increment value: Pass 0 to use the same value else you can provide the interval value. The date or time interval will be in:
      1. Milisecond
      2. Second (Default)
      3. Minute
      4. Hour
      5. Day
      6. Month
      7. Year
  4. Value change policy: To define the setting when the next date/time will be picked
    1. On each use (Default value)
    2. On each request
    3. On each page
    4. On each iteration
    5. For each Virtual User instance
  5. Variable values distribution policy: To define the scope and distribution setting of the variable
    1. Scope: The available values are:
      1. Local
      2. Global (Default Value)
      3. Unique

Example

Consider, a personal detail submission form scenario where all the virtual users need to fill the personal details in the form and the details in the form are:

  1. Name
  2. Date of Birth
  3. Credit Card Number
  4. Credit Card Expiry Date

Now, we have to parameterize all the above attributes. So, we will define 1 ‘Random String’ variable for Name, 1 ‘Random Integer‘ variable for Credit Card Number and 2 ‘Date’ type variables for Date of Birth and Credit Card Expiry Date. Please note that the date pattern for both variables will be different i.e. dd/MM/yyyy for Date of Birth and MM/yy. Refer to the below screenshot for better understanding:

NeoLoad – Date Variable
Figure 01

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

Example: ${DoB} and ${ccExpireDate}

NeoLoad – Date 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 – Date Variable - Test
Figure 03

You may be interested:


Leave a Reply

Your email address will not be published. Required fields are marked *