Generate Graphical JMeter Report at the End of Test Run
Reporting is one of the most crucial tasks in any project’s QA activities. And in load tests, your report is expected to be comprehensive enough for concerned stack holders. However, we have seen many JMeter users complain about lack of reporting capability in JMeter. This article therefore shows a simple trick to generate graphical JMeter report at the end of test run.
This JMeter report is generated in HTML format using Apache Ant tool. So, make sure you have Apache Ant installed and configured properly in your system. After that perform below steps to generate the HMTL report.
- Navigate to ‘extras’ directory in your JMeter setup.
- Open build.xml file located there in choice of your editor.
- Search for ‘style’ attribute in ‘xslt-report’ target of opened Ant file.
- Set ‘style’ value to ‘C:/apache-jmeter-2.11/extras/jmeter-results-detail-report${style_version}.xsl’. Change JMeter directory value as per your installation.
- Save build.xml file and close it.
- Copy your JMeter script(JMX file) in ‘extras’ directory of JMeter.
- Now, open Command Prompt and navigate to ‘extras’ directory.
- Run following command to start load test.
1ant –Dtest = <jmx file name without JMX extension>
For example if your script name is TestScript.jmx, your command should be as below.
1ant –Dtest = TestScript - After completion of test run, you should see HTML report in ‘extras’ directory. It should look like below.
- As you can see in above screenshot, the HTML report contains essentials details such as failure cause, average response time, minimum and maximum times, failure rate etc. You can send this HTML file as part of your performance test result report.
Since JMeter’s capability to generate report out of the box is limited, above trick to generate graphical JMeter report may come in handy to you at some point. Do you know any other ways we can generate reports in JMeter? Share with us in comments.
Thanks Maharshi for clean and simple steps
HI Maharshi,
Can you please give some details(steps) on how to configured Apache Ant.
Thanks,
Kishore
HI Maharshi,
Can you please give some details(steps) on how to configured Apache Ant.
ant –Dtest = TestScript
Not running
How it will without ant configuration?
Thanks,
Pramod
Hi,
Hope you have already downloaded and installed java development tool kit (JDK) on your computer.
Make sure that JAVA_HOME environment variable points to the folder where JDK is installed.
To configure ANT:
1. Download the binaries from http://ant.apache.org/
2. Unzip the file into a folder
3.Create environment variable ANT_HOME, point it to the ant installation folder
Ex:
SET ANT_HOME=C:\Users\sravanthi\Downloads\apache-ant-1.9.4-bin
4.Set PATH environment variable for ANT
SET PATH=%ANT_HOME%/bin;
Good explanation.
This report is clear that Jtl report…very nice trick…thanks for sharing sravanthi
After generating the results , in the html file previous results are also appending .so I am not able to view the current reslts
Hi,
Is there any way to save the graphs generated in the html file?
like, response times graph, transactions per sec graph etc. ??
Hello,
I had installed ANT on my Windows 7 (32 bit) machine as per the steps mentioned above. But when I execute command “ant –Dtest = ReportTest” (‘ReportTest’ is my jmx file name), I get the following message in console.
====================
Buildfile: F:\JMeter\apache-jmeter-2.12\extras\build.xml
BUILD FAILED
Target “ûDtest” does not exist in the project “ant-jmeter”.
Total time: 0 seconds
====================
Hence, I am not getting any HTML report as well after i run my test (ReportTest).
Try to use JRE 1.7 or older. JRE 1.8 will not allow to access file not existing
Hey guys, I’m trying this trick, but I’m receiving this error:
C:\apache-jmeter-2.13\extras>ant -Dtest = Test
Buildfile: C:\apache-jmeter-2.13\extras\build.xml
run:
[echo] funcMode = false
[jmeter] Executing test plan: C:\apache-jmeter-2.13\extras\Test.jmx ==> C:\ap
ache-jmeter-2.13\extras\Test.jtl
_message_xalan:
xslt-report:
BUILD FAILED
C:\apache-jmeter-2.13\extras\build.xml:132: input file C:\apache-jmeter-2.13\ext
ras\Test.jtl does not exist
Total time: 6 seconds
Try if the path to ‘Style’ in build file is given properly.
Hi Gustavo,
Did you find any solution regarding the same, as I am getting the same error.
Hi,
Please help me out I am getting this error.
Buildfile: D:\Jmeter\apache-jmeter-2.13\extras\build.xml
BUILD FAILED
D:\Jmeter\apache-jmeter-2.13\extras\build.xml:88: taskdef doesn’t support the “r
ef” attribute
Hi,
Is it possible to see the logs inside the html report? Any idea?
Hi,
If it helps anyone, i had the same problem, but what i found is that if you have any listener in the test plan it can cause errors.
Its really very helpful article. Thanks a lot 🙂
I am getting an error as
BUILD FAILED
Target “Results” does not exist in the project “ant-jmeter”.
Im getting the following during the build. I installed Ant and working properly. Any suggestion?
i.e.
Buildfile: C:\Users\xxxxxx\Desktop\apache-jmeter-2.13\apache-jmeter-2.13\extras\build.xml
BUILD FAILED
C:\Users\xxxxxx\Desktop\apache-jmeter-2.13\apache-jmeter-2.13\extras\build.xml:80: The value of attribute “dir” associated with an element type “null” must not contain t
he ‘<' character.
Total time: 0 seconds
il faut mettre le nom du fichier JTL contenant le rapport agrégé en sortie et non le JMX 🙂
This is what I am looking, now, I got clarified my doubt regarding jmeter.