0
votes

I am tring to generate the html report using ant for that I have performed below steps In my machine java and jmeter is already installed. I performed below steps

  • Download Apache Ant and unzip it. Copy the complete unzipped folder to C:\apache-ant-1.9.11-bin
  • Open Jmeter folder and then open Extras folder shown inside Jmeter forlder : C:\apache-jmeter-4.0\apache-jmeter-4.0\extras
  • Copied the Extras folder and pasted it to C:\apache-ant-1.9.11-bin\apache- ant-1.9.11\bin
  • Updated build.xml

     Djmeter.home=.. - C:\apache-jmeter-4.0\apache-jmeter-4.0
     <property name="jmeter.home" value="C:\apache-jmeter-4.0\apache-jmeter-4.0"/>
    
  • Created Test.jtl file at C:\apache-ant-1.9.11-bin\apache-ant-1.9.11\bin

  • Opened the command promt and run below command

    C:\apache-ant-1.9.11-bin\apache-ant-1.9.11\bin>ant
    

It generates belew Error message on command promt.

Unable to locate tools.jar. Expected to find it in C:\Program Files (x86)\Java\jre1.8.0_144\lib\tools.jar Buildfile: C:\apache-ant-1.9.11-bin\apache-ant-1.9.11\bin\build.xml

As per your suggestion I added the code below still facing the below error.

ErrorGenerated

here is the path for tool.jar file that I set in above image.

Tools path

1

1 Answers

0
votes
  1. With regards to "tools.jar" message it indicates that your Java installation differs from what Ant expects, probably you didn't select option to install Public JRE during Java setup. So the options are in:

    • Either re-install Java with Public JRE now (and preferably to the location which doesn't contain spaces or national characters in its path)
    • Or ignore the warning, it should not have impact on JMeter
  2. Manipulations with copying "extras" folder are not necessary, you can verify that JMeter Ant Task is working by just running ant inside "Extras" folder, assuming everything goes well it should generate Test.html file there

Also be aware that starting from JMeter 3.0 there is an option to generate HTML Reporting Dashboard with way more detailed information than Ant task provides.

References: