Generate HTML Reports for Test Results with Artillery

Karthik S
2 min readFeb 15, 2024

--

Generating comprehensive reports is crucial for analyzing test results effectively. Artillery, a modern, powerful load testing toolkit, offers functionalities to create HTML reports from test data. In this guide, we’ll walk through the process of generating HTML reports for your test results using Artillery

Setting Up the Reports Directory

Ensure you have a directory dedicated to storing your test reports. Follow these steps to create a directory named ‘reports’. I’m using the Linux operating system, so I’ll create a directory using the following command

mkdir reports

Running Test and Creating JSON Report

With the reports directory set up, execute your tests using Artillery. Utilize the --output flag to generate a JSON report. Here's an example command

artillery run --output reports/my-script.json my-script.yml

Replace my-script.yml with the filename of your Artillery test script. This command runs the test and saves the results in JSON format to reports/my-script.json

Generating HTML Report

Now that you have the JSON report, it’s time to transform it into a more human-readable format using Artillery. Execute the following command

artillery report --output reports/my-script.html reports/my-script.json

This command instructs Artillery to generate an HTML report (my-script.html) based on the JSON report (my-script.json). Once executed, you'll find the HTML report in the reports directory

Analyzing the HTML Report

The generated HTML report provides insightful visualizations and metrics derived from your test data. You can analyze response times, error rates, throughput, and other performance metrics to evaluate the performance of your system under load.

Conclusion

Generating HTML reports for your test results with Artillery streamlines the process of analyzing performance and identifying potential bottlenecks in your system. By following the steps outlined in this guide, you can efficiently generate informative reports to optimize your application’s performance and reliability.

Remember to replace placeholders such as my-script.yml with your actual file names.

Reference https://www.artillery.io/docs/reference/cli/report#generating-an-html-report

--

--

Karthik S
Karthik S

Written by Karthik S

🚀 DevOps Engineer | Exploring cloud, automation, and infrastructure

No responses yet