Reputation: 5824
I have been using JMeter in GUI mode for composing all the test cases required for load testing my service but for actual testing I need to execute tests in non-GUI mode. How do I save the results of Aggregate report in csv file using command-prompt.
Thanks in advance.
Upvotes: 26
Views: 52449
Reputation: 21
Download JMeterPluginsCMD.
Move jmeter-plugins-manager-0.13.jar into /bin/libs/ext of your JMeter.
./JMeterPluginsCMD.sh --tool Reporter --generate-csv test.csv --input-jtl input.jtl --plugin-type AggregateReport
Upvotes: 2
Reputation: 794
With the help from the above answer, I wrote a simple bash script to automate the work of generating aggregated result .csv
file using .jtl
files
You can put this script in the folder where .jtl
files are in , and just run the script in that directory.
Then, it will put all the aggregated reports(.csv
files) in the aggregate_report
directory in the same directory
#! /usr/bin/env bash
echo "Generating reports..."
command_runner="/opt/apache-jmeter-2.13/lib/ext/CMDRunner.jar"
output="aggregate_report"
count=0
mkdir $output
for sample_file in *.jtl
do
((count++))
filename="${sample_file%.*}"
echo "Converting $filename"
java -jar $command_runner --tool Reporter --generate-csv ${output}/${filename}.csv --input-jtl ${filename}.jtl --plugin-type AggregateReport
done
echo "$count files were converted."
note: change the
command_runner
variable accordingly with your CMDRunner.jar location
Upvotes: 0
Reputation: 17095
1. Save result file
Specify a result file to saved into in View Results Tree or View Table Results (in CSV or XML). Ex: out/test-results.csv
or with CLI argument -JTEST_RESULTS_FILE=out/test-results.csv
2. Convert to report
Convert the result file into an aggregate report:
$ java -jar CMDRunner.jar --tool Reporter --generate-csv aggregateResults.csv --input-jtl out/test-results.csv --plugin-type AggregateReport
If you use brew
, CMDRunner is located at:
/usr/local/Cellar/jmeter/2.13/libexec/lib/ext/CMDRunner.jar
Upvotes: 6
Reputation: 2658
Use JMeterPluginsCMD tool with Plugin Type = AggregateReport
Upvotes: 9
Reputation: 12873
Just as alternative: you may do this directly from the Aggregate Report listener.
1. set filename/template for results file:
resultsFile = ${__property(user.dir)}${__BeanShell(File.separator,)}result_${__time(yyyyMMdd-HHmmss)}.csv
2. configure Aggregate Report listener as shown below:
CSV-file generated in this case will differ from generated via GUI/"Save Table Data" one.
If it is not acceptable you'll better use method with JMeterPluginsCMD from previous answer:
java -jar JMeterPluginsCMD.jar --generate-csv aggregateResults.csv --input-jtl testResults.jtl --plugin-type AggregateReport
Upvotes: 15