HTML Reporting for Jmeter Results
Jmeter Usually makes the results file in .jtl which limited interms of readability. So we can convert the .jtl files in the HTML reports. Please find the steps for doing so mentioned below,
Step 1 : Install Ant
In my case i have installed ant -> apache-ant-1.9.7
add the ANT_HOME system variables and add the ant bin path in the user variables.
if you have successfully set up ant then you should get the below message when you run ant command in command prompt
C:\>ant Buildfile: build.xml does not exist! Build failed
Step 2 : Install Jmeter
Step 3 : go to the build.xml and change the following
Download the updated xslt (named-> jmeter-results-summary-report_details ) make sure that is there in your jmeter/extras
Open the build.xml file and point it to the new updated xslt file
<xslt
classpathref="xslt.classpath" force="true" in="${testpath}/${test}.jtl" out="${testpath}/${test}.html" style="C:\Users\andeb\Desktop\apache-jmeter-3.1\apache-jmeter-3.0\apache-jmeter-3.0\extras\jmeter-results-summary-report_details.xsl"> <param name="showData" expression="${show-data}"/> <param name="titleReport" expression="${report.title}"/> <param name="dateReport" expression="${report.datestamp}"/> </xslt>
3. To get all the details in the HTML report update the following in the build.xml file
<property name="jmeter.save.saveservice.response_data" value="true"/> <property name="jmeter.save.saveservice.samplerData" value="true"/> <property name="jmeter.save.saveservice.responseHeaders" value="true"/> <property name="jmeter.save.saveservice.requestHeaders" value="true"/> <property name="jmeter.save.saveservice.encoding" value="true"/> <property name="jmeter.save.saveservice.url" value="true"/> <property name="jmeter.save.saveservice.filename" value="true"/> <property name="jmeter.save.saveservice.hostname" value="true"/> <property name="jmeter.save.saveservice.thread_counts" value="true"/> <property name="jmeter.save.saveservice.sample_count" value="true"/> <property name="jmeter.save.saveservice.idle_time" value="true"/>
Running ant :
Open Command Prompt and type the below command
ant -Dtest=Script Name
Now it is possible to hard code the jmeter script in the build.xml , in that case hard code the jmx in the build.xml and make a bat file (this will remove the process of reputability)
Sample HTML result :
Debugging :
NOTE 1: while debugging please check if the two jar which are responsible for xslt transformation is there in jmeter folder (xalan and/or serialiser jars)
NOTE 2: Again when debugging please make sure that you have changed the jmeter properties to save the result in xml format. (default is csv)
# legitimate values: xml, csv, db. Only xml and csv are currently supported. jmeter.save.saveservice.output_format=xml
NOTE 3: If you see an error message such that there is no jtl file, it is recommended to run the jmeter script once and generate the jtl file for the first time
NOTE 4: If you permission issues then try opening the command prompt in administrator mode.