How to handle Epoch/UNIX Dynamic Timestamps in NeoLoad

Many web applications use Epoch/UNIX timestamp values for validation and session info. When NeoLoad records a User Path, it marks the current value and timestamp. When replayed, these values and timestamp could be out of date and invalid, causing the script to fail in different ways: 401 Unauthorized, 403 Forbidden, or even 500 Internal Error, etc.

There is no automatic way to handle this today inside of NeoLoad, nor is it difficult to execute manually. All you have to do is create a variable using the "Search and Replace" function. The value might be in the form of "1514813730000", which would convert to "Monday, January 1, 2018, 8:35:30 AM Eastern US time zone (EST)". If you are keeping score, this is the amount of time in milliseconds since January 1, 1970. Many Unix systems store epoch/UNIX dates as a signed 32-bit integer, which might cause problems on January 19, 2038 (known as the year 2038 issue or Y2038).

Here are some easy steps to manage the dynamic timestamps in your NeoLoad script:

  1. Create a NeoLoad variable based on "Current Date" type and use the pattern "CurrentTimeMillis" for the Epoch/UNIX time. Save with an easy to reference name.
  2. Perform a "Search and Replace" (Control-F) for all values that might match (search globally), using "Regular Expression" (check the box within Search and Replace window). In the Search field, use the following expression (value is from the above example, your value might differ): "15148[0-9]{8}".

    Alternatively, this syntax works as well "15148\d{8}." [0-9] is a wildcard, and "\d" represents any numerical value in its place. "{x}" suggests that you repeat this pattern x times.
  3. In the replace box, put the name of the "Current Date" variable you created from Step #1. Click Next, and Finish. Use "Replace ALL" when searching – you should find all the occurrences at once.