Search code examples
jmeterperformance-testing

JMeter - Increment Epoch time by 1 in every subsequent request


I have a request with epoch time say 1706777576807 as parameter. My next requests should send the values as 1706777576808, 1706777576809, 1706777576810 and so on.

Am aware that epoch time for the current timestamp could be generated using ${__time()}. How do I increment the value by one here?

Please help. Thanks for your support.

Regards,


Solution

  • In first request add the last argument to the __time() function to store the generated timestamp into a JMeter Variable like:

    ${__time(,time)}
    

    In 2nd and subsequent requests use __longSum() function to increment the value by 1 and store the result into the aforementioned time variable like:

    ${__longSum(${time},1,time)}
    

    Demo:

    enter image description here

    More information on JMeter Functions concept: Apache JMeter Functions - An Introduction