Generate HTML reports for JMeter Using ANT
Generate HTML reports
for JMeter we can use Apache ant (JMeter apache)
Installation steps:
Step 1: Download Apache
Ant from
here : https://ant.apache.org/bindownload.cgi
Step 2: Copy ant-jmeter-xxx
from C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2\extras
to C:\apache-ant-1.9.14\lib
Step 3: Install Ant and
setup ANT_HOME : D:\apache-ant-1.9.14 in user variables of Environment
Variables.
Step 4: Update path in
System variable with ;D:\apache-ant-1.9.14\bin.
Note: To check whether have installed Ant properly or
not.
-Just go to command
prompt and type Ant -version.
- Ant version will
display
Step 6: Now open build.xml present in C:\apache-jmeter-2.13\extras.
Step 7: change the build.xml like this
</description>
<property name=”testpath” value=”C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2\extras“/>
<property name=”jmeter.home” value=”C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2“/>
Step 8: Put jmeter script .jmx file in extras folder and update testpath with this path and jmeter.home with installation directory.
Step 9: Update testfile name (.jmx file name) in property name=”test”
Step 10: Update jmeter.classpath with jar location
<!– Allow jar to be picked up locally –>
<path id=”jmeter.classpath”>
<fileset dir=C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2\extras”>
<include name=”ant-jmeter*.jar”/>
</fileset>
</path>
Step 11: Update style in xslt.classpath with xsl file location. Generally xsl file will be available in jmeter extras folder .
<target name=”xslt-report” depends=”_message_xalan”>
<tstamp><format property=”report.datestamp” pattern=”yyyy/MM/dd HH:mm”/></tstamp>
<xslt
classpathref=”xslt.classpath”
force=”true”
in=”${testpath}/${test}.jtl”
out=”${testpath}/${test}.html”
style=”C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2/extras/jmeter-results-detail-report_21.xsl”>
<param name=”showData” expression=”${show-data}”/>
<param name=”titleReport” expression=”${report.title}”/>
<param name=”dateReport” expression=”${report.datestamp}”/>
</xslt>
</target>
Step 12: Save the build.xml and close it.
Step 13: Just go the command prompt ,change the directory to Jmeter Extras folder location and Execute Ant.
Step 6: Now open build.xml present in C:\apache-jmeter-2.13\extras.
Step 7: change the build.xml like this
</description>
<property name=”testpath” value=”C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2\extras“/>
<property name=”jmeter.home” value=”C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2“/>
Step 8: Put jmeter script .jmx file in extras folder and update testpath with this path and jmeter.home with installation directory.
Step 9: Update testfile name (.jmx file name) in property name=”test”
Step 10: Update jmeter.classpath with jar location
<!– Allow jar to be picked up locally –>
<path id=”jmeter.classpath”>
<fileset dir=C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2\extras”>
<include name=”ant-jmeter*.jar”/>
</fileset>
</path>
Step 11: Update style in xslt.classpath with xsl file location. Generally xsl file will be available in jmeter extras folder .
<target name=”xslt-report” depends=”_message_xalan”>
<tstamp><format property=”report.datestamp” pattern=”yyyy/MM/dd HH:mm”/></tstamp>
<xslt
classpathref=”xslt.classpath”
force=”true”
in=”${testpath}/${test}.jtl”
out=”${testpath}/${test}.html”
style=”C:\JEMETER\apache-jmeter-3.2\apache-jmeter-3.2/extras/jmeter-results-detail-report_21.xsl”>
<param name=”showData” expression=”${show-data}”/>
<param name=”titleReport” expression=”${report.title}”/>
<param name=”dateReport” expression=”${report.datestamp}”/>
</xslt>
</target>
Step 12: Save the build.xml and close it.
Step 13: Just go the command prompt ,change the directory to Jmeter Extras folder location and Execute Ant.
Happy Testing!!!!
Comments
Post a Comment