1

This is my bat file:

cd C:\apache-jmeter-5.4.1\bin
CALL rd /s /q C:\NewPerformanceTask\Raport\HTML
CALL Del "C:\NewPerformanceTask\Raport\log.csv"
jmeter.bat -n -t C:\NewPerformanceTask\EdidtedNewJmeterscript.jmx ^
-l C:\NewPerformanceTask\Raport\log.csv -e -o C:\NewPerformanceTask\Raport\HTML ^
-Jduration=%1 -Jusers=%2 -Jjmeterengine.force.system.exit=true

As you can see here, I always delete the previous report and after finishing the run, another report is generated. How can I keep all reports and generate a report with a random name after each run?

Thank you in advance!

user7294900
  • 47,183
  • 17
  • 74
  • 157

3 Answers3

0

You can add the time of the execution to your folder, for example using script

set hour=%time:~0,2%
if "%time:~0,1%"==" " set hour=0%time:~1,1%
...
-o C:\NewPerformanceTask\Raport\HTML\%date:~10,4%-%date:~4,2%-%date:~7,2%_%hour%%time:~3,2%
user7294900
  • 47,183
  • 17
  • 74
  • 157
  • and I need to delete this two lines from my bat file? CALL rd /s /q C:\NewPerformanceTask\Raport\HTML CALL Del "C:\NewPerformanceTask\Raport\log.csv" – Vadim Pasat Mar 15 '21 at 11:07
  • @VadimPasat you can use `-f` , see https://jmeter.apache.org/usermanual/get-started.html#options – user7294900 Mar 15 '21 at 11:12
0

You can add a current timestamp to your .jtl file name i.e. replace log.csv with something like log-%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%.csv

enter image description here

If you need to overwrite the results with the newer ones it's easier just to provide -f command-line option, it's available since JMeter 2.13

Dmitri T
  • 119,313
  • 3
  • 56
  • 104
0

Thanks a lot for the answers. They helped me solve the problem