Prerequisites:
1. ‘Apache-ant’ is the Pre-requisite for generating the report from the jmx file. Apache Ant is a Java-based build tool.
2. Ant-jmeter.jar
Steps:
1. Create a new variable JAVA_HOME in the environment variable and set the path for the jdk.
2. You can find the Environment variable by right clicking on the computer Icon then properties-> Advance-> environment variable. Then click on the new and give the variable name as well as path also.
3. Likewise create another variable ANT_HOME and set the path for the Apache-ant.
4. Create another variable PATH and set the path for apache-ant up to bin folder as shown in the fig. bellow.

5. Place the ant-jmeter.jar file in side ‘Extras’ folder. Which is located in the path jakarta-jmeter-2.3.2->extras
6. Navigate to the ‘build.xml’ folder of the jmeter which is located in the path jakarta-jmeter-2.3.2->extras->build.xml.
7. Set the classpathref = “d:/jakarta-jmeter-2.3.2/extras/ant-jmeter.jar “
8. Set jmeterhome=”D:/jakarta-jmeter-2.3.2″
9. Set style=”D:/jakarta-jmeter-2.3.2/jmeter-results-detail-report${style_version}.xsl” and save it.
10. Now copy your jmx file and the build.xml file put it in a folder where ever you want to generate the report.
11. Open your command prompt and navigate to the folder where your jmx and build file is located.
12. To run a test and create the output report:
Type the command “ant -Dtest=script”(for eg. I have my test.jms file and the command is ant-Dtest=test)
It will generate an Html file. This can be open in the browser as shown in the fig. bellow.

13. To run a test only:
Type the command “ant -Dtest=script run”
14. To run report on existing test output
Type the command “ant -Dtest=script report”
Filed under: Uncategorized
Please note that there should be a spce beteween ant and -Dtest command.
For e.g. if the script is Test.jmx then type the command as follows.
ant -Dtest=Test
I tried running the comand after following all the steps provided ,I get the following error in my cmd prompt:
C:\Jmeter\jakarta-jmeter-2.3.4\extras>ant -Dtest=test
‘ant’ is not recognized as an internal or external command,
operable program or batch file.
Thanks for these tips,, I have tried all these steps but its not working when i m running the command “ant -Dtest run” having my test.jmx as my jmeter script.
i m getting the error
BUILD FAILED
C:\jakarta-jmeter-2.3.2\extras\build.xml:85: Reference C:/jakarta-jmeter-2.3.2/
extras/ant-jmeter.jar not found.
Jmeter and Ant are in C drive and hv checked the environment variables
This is the link for the original tutorial:
http://www.programmerplanet.org/pages/projects/jmeter-ant-task.php
Hi Tarun
Just include “ant-jmeter-1.0.9.jar” in your Ant classpath. This jar comes with Jmeter2.3.2. According to ur problem it is searching for ant-jmeter.jar which comes in Jmeter2.3.1 and not in 2.3.2.
May this will help you.
Hi,
I am getting below error –
BUILD FAILED
.xml:85: taskdef class org.programmerplanet.ant.taskdefs.jmeter.JMeterTask canno
t be found
What could be the reason.
Regards,
Kshitij
I am getting below error
BUILD FAILED: .xml.84: Element type “taskdef” must be followed by either attribute specification, “>” or “/>”.
I tried this step by step. Its not working and getting error message in my console.
C:\Documents and Settings\Vinod\Desktop\Spring Travel>ant -Dtest=spring2.jmx
Buildfile: C:\Documents and Settings\Vinod\Desktop\Spring Travel\build.xml
BUILD FAILED
C:\Documents and Settings\Vinod\Desktop\Spring Travel\build.xml:85: Reference D:
\Jmeter\jakarta-jmeter-2.4\extras\ant-jmeter-1.0.9.jar not found.
Total time: 0 seconds
Hi,
I have more than 100 Jmeter scripts and every script contains more then 10 action. I run them from ANT and by default HTML report contains report for every action (100×10=1000 lines). I dont need result for every action, I need in report only result for TestPlan – pass or false. Is it possible to custom it in ANT?
Thanks