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’
- Name: specify the name of the variable to be used in the script. This entry is required.
- Description: explain the function of the variable. This entry is not required.
- Parameters: to specify the meaning and pattern
- 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.
- Start time or date: specify the start time or date. The date can also be selected using a calendar.
- 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
- 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
- Variable Value Distribution Policy: To define the scope and framework of the variable’s distribution
- Scope: The available values are
- Local
- Global (Default Value)
- Unique
- Scope: The available values are
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:
You must enter the variable name as $ in the script to use it.
For example $DoB and $ccExpireDate
Note: The ‘Test’ option also allows you to confirm the value of the variable. The variable should return the correct result.