'User Defined Value (Date) is changing within Jmeter test plan

I have user defined variable for date: Date1 | 31-Jul-2018. Now I am using this variable within my test plan, and on each iteration, I will be decrementing the date too for which I have code in JSR223 processor but that gets executed at the end of first iteration. The issue I am facing is that in the beginning of the test plan, date is being displayed correctly within my SQL query, but then towards the end of the test plan when I need to use the date again, Date value has changed and showing some random value like - '03-Jul-0208'. Just an fyi - we haven't reached the Date decrement code yet when i start getting this random value.

Test plan structure: Test plan

I have no idea why this is happening.



Solution 1:[1]

Just FYI you have reached the Date decrement code as soon as you executed JDBC_SelectDCNfromTemp sampler first time.

JSR223 PostProcessor is being executed after each Sampler in its scope so most probably the error is in your code which you're unwilling to share.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T