Home | License | FAQ | Contact | Smart-API

_Last Updated: October 13, 2022

In this tutorial, we will show you the required steps to verify which backend code is being called by the front-end during the manual or automated testing.

This tutorial is applied to Java Web Applications deployed on Tomcat, however, it could be also applied to any Java based application deployed as Standalone or as a Docker container.



  1. Create “test” folder inside your Apache-tomcat home, and as shown below, place the following jars inside it:

    1. jacocoagent.jar

    2. jacocoant.jar

    3. jacococli.jar

    jacoco files
  2. In the “test” folder, create “to-html.bat” file that, which contains the following script:
    java -jar jacococli.jar report test.exec --classfiles ../webapps/app/WEB-INF/classes --html html

  3. In Apache-tomcat home “bin” folder, create setenv.bat with the following contents:
    SET CATALINA_OPTS=-javaagent:../test/jacocoagent.jar=destfile=../test.sexec,includes=com.app.*,append=false

  4. Start the tomcat with startup.bat script inside the bin folder.

  5. Deploy your app on tomcat by placing the war file inside the webapps folder(app.war for example).

  6. Run the tests on your app either manually or automatically using something like Selenium.

    app screen
  7. When done, shutdown the tomcat using bin/shutdown.bat batch inside tomcat.

  8. Inside tomcat/test double click on to-html.bat file, then an html folder will be created.

  9. Run index.html and you will be able to see the something like the following results:

jacoco results
jacoco results
jacoco results

The end

Home | License | FAQ | Contact | Smart-API