In JMeter (5.1.1) I have a summary report that I'm trying to save as a timestamped file. The filename value looks like the following:
D:\Load Tests\example.com\Results\${__time(yyyy-MM-dd-HH-mm-ss,)}_summary.csv
However, rather than create the file with the result of the __time()
function e.g. 2019-07-22-10-24-03_summary.csv
, it's actually generating a filename called ${__time(yyyy-MM-dd-HH-mm-ss,)}_summary.csv
.
I've tried creating a user-defined variable called timestamp
with the value ${__time(yyyy-MM-dd-HH-mm-ss,)}
and referencing it with ...\${timestamp}_summary.csv
but this similarly results in $(timestamp)_summary.csv
.
I saw a JMeter Archive post regarding a similar question to mine from 2006 where it's implied that listener filenames are resolved too early for functions and variables to be used, but I'm hoping that JMeter has been able to overcome this hurdle in the 13 years since then.
Is it possible to use variables for listener filenames in JMeter GUI and set them dynamically like the timestamp above?
If not, is there an alternative method of doing this using Groovy? Where would this be - in a setup thread JR223 sampler perhaps? I have tried this and seemingly managed to programatically change the filename, but no file was saved.
Update with answer:
I just needed to reverse the path delimiters from \
to /
.
D:/Load Tests/example.com/Results/${__time(yyyy-MM-dd-HH-mm-ss,)}/summary.csv