JohnSmith
JohnSmith

Reputation: 1268

How to add date to JMeter csv result file while running in command line mode

How can I add the actual date to the file name of a JMeter csv result file while running the test in command line mode? E.g.

jmeter -n -t ~/tests/TP_Login_api.jmx -Jusers=12 -Jhost=devops1 -Juser_file=users_max.csv -Jaccount=max -l /results/results_TP_Login_api_${__time(yyyyMMdd-HHmmss)}.csv -e -o/results/report/TP_Login_api

Any ideas how dto achieve that?

Upvotes: 0

Views: 638

Answers (1)

Ori Marko
Ori Marko

Reputation: 58772

In batch you need to work with batch syntax. For Bsh use:

 #!/bin/bash
 NOW=$(date +"%m-%d-%Y")
 jmeter -n -t ~/tests/TP_Login_api.jmx -Jusers=12 -Jhost=devops1 -Juser_file=users_max.csv -Jaccount=max -l /results/results_TP_Login_api_$NOW.csv -e -o/results/report/TP_Login_api

For windows see date.

Upvotes: 1

Related Questions