1

I have a scheduled load test which runs daily. Scripts are triggered from CLI (.bat file) and will be creating a html report at the end of the test.

I am saving test report with testnameDATE, where currently the date part is updated manually.

I tried to automate the date part to get the system date on run time using '${__time(MMddyyyy)}', but for html part its not working and report is not getting created.

Eg:

D:
cd D:\Performance Testing\Tools\apache-jmeter-3.0\bin
jmeter -n -t "D:\Performance Testing\batch\DailyRun\Test_DailyRegression.jmx" -l "D:\Performance Testing\batch\DaiyRun\csv\Test${__time(MMddyyyy)}_001.csv"   -e -o "D:\Performance Testing\batch\DaiyRun\html\Test${__time(MMddyyyy)}_001.html"
Compo
  • 30,301
  • 4
  • 20
  • 32
Arun
  • 89
  • 11
  • Possible duplicate of [Creating a file name as a timestamp in a batch job](https://stackoverflow.com/questions/1064557/creating-a-file-name-as-a-timestamp-in-a-batch-job) – Kiril S. May 07 '18 at 16:27
  • You should use command line syntax, like in linked question, not JMeter syntax – Kiril S. May 07 '18 at 16:28
  • @Kiril That's a rather old Q&A, today I'd recommend a user settings/locale independent solution using wmic or [powershell](https://stackoverflow.com/a/45683402/6811411). –  May 07 '18 at 16:41
  • You didn't quote a path containing spaces, that should be `cd /d "D:\Performance Testing\Tools\apache-jmeter-3.0\bin"` –  May 07 '18 at 16:43

1 Answers1

0

Windows doesn't know anything about JMeter Functions, given you run your JMeter test in command-line non-GUI mode you will need to use date command instead like:

jmeter -n -t ..\extras\Test.jmx -l Test_%date:~10,4%%date:~4,2%%date:~7,2%_001.csv

Demo:

JMeter create timestamp results

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