NeoLoad – Current date variable
NeoLoad’s “Current Date” variable type creates the current date and time in the desired format for the script. Depending on the needs of the script, you can set a pattern for the date or time. In order to allow different values to be given in the request of several virtual users, NeoLoad offers the option to increment the date or time value in a range of seconds, milliseconds, minutes, hours, days, months, and years.
The ‘Current Date’ variable type is specifically used to include the most recent timestamp in the request. The timestamp is usually in epoch format.
Variable inputs of type ‘Current date’
- Name: specify the name of the variable to use 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 provide the current date/time pattern, eg dd/MM/yyyy HH:mm: ss. You have the option of creating a custom pattern or choosing from a drop-down selection of pre-defined options.
- Increased value: If you pass 0 instead of the range value, the value will remain the same. The time or date will be displayed in the following format:
- Millisecond
- Second (Default)
- Minute
- Hour
- Day
- Month
- year
Example
Consider an order shipping page where you click the “Submit Order” button but the time and date have already passed. We must create a variable of type ‘Current Date’ to be able to parameterize the current timestamp. Please refer to the following screenshot for clarification:
You must enter the variable name as $ in the script in order to use it.
For example, $currentDT
Note: The ‘Test’ option also allows you to confirm the value of the variable. The variable must produce the correct result.