The HTML Report - A Definitive Tool
Table of Contents
Intermediate - This article is part of a series.
Once a test execution is completed in CLI (non-GUI) mode, there are two options to visualize the results: 1. read the results file (jtl) using JMeter in GUI mode and use complements (plugins) to graph the results, or 2. produce the HTML report. In this entry, I present a tool (shell script) that will allow you to generate the HTML report efficiently, along with other benefits:
- generate the HTML report using the file generated by the test execution (jtl)
- archive relevant test information
Important Benefit #
The second point is extremely important as it enables gathering all relevant test information in a permanent and unambiguous manner: the script creates a unique directory (using a timestamp stamp) where required files for creating the report are stored. Additionally, the script copies the following files to the mentioned directory:
- *.jmx (JMeter script file)
- *.jtl (JMeter log/bitlog file)
- jmeter.log (JMeter run log file)
- errors.xml (error log/bitlog - optional)
Usage #
The usage is very simple. The first step is to execute the JMeter script in CLI mode:
jmeter -n -t scenario.jmx -l scenario.jtl
In the second step, run the tool using the jtl file as a parameter:
jmRpt.sh scenario.jtl
The script creates a unique directory with a timestamp stamp (e.g., 2020-09-25_18:36:58.391). The list of the directory will be approximately like this:
ls -l 2020-09-25_18:36:58.391
total 760
-rw-r--r-- 1 carlos staff 36657 Sep 26 19:05 scenario.jmx
-rw-r--r-- 1 carlos staff 293822 Sep 25 18:27 scenario.jtl
drwxr-xr-x 5 carlos staff 160 Sep 25 18:37 content
-rw-r--r--@ 1 carlos staff 9678 Sep 25 18:37 index.html
-rw-r--r-- 1 carlos staff 2598 Sep 25 18:34 jmeter.log
drwxr-xr-x 7 carlos staff 224 Sep 25 18:37 sbadmin2-1.0.7
-rw-r--r-- 1 carlos staff 992 Sep 25 18:37 statistics.json
Finally, change to the directory and open the HTML report in the browser:
open index.html
Downloading the Tool #
The tool (and the README file) can be downloaded as follows:
git clone git@github.com:cgodinez1271/jmeter-dashboard-rpt.git
Note: This script has been designed to run on MacOS. It may work on Linux.