The Tesults web app is designed for desktop browsers. Sign up and configure your project on a laptop or desktop. Use the iOS app or Android app to view results on the go.

JSON test results data format for test frameworks

For consistency, interoperability, efficiency and compliance

blog-title-image

There is no universal standard for how test frameworks output results data. Each framework represents its results in its own custom format, and even the listener or event interfaces they expose for programmatic access are specific to each framework. The closest thing to a common format is JUnit XML, which many frameworks can emit, but XML has real drawbacks and JSON has become the more widely used format for data interchange. This post explains why the formats differ, how JUnit XML and JSON compare for test results, and what a standard JSON format for test results looks like in practice.

Why does every test framework output results differently?

Test frameworks were built independently, at different times, for different languages, by different authors, with no shared specification for what results should look like. So pytest, JUnit, Jest, TestNG, Mocha, NUnit, Go, and the rest each represent a test result in their own structure, with their own field names and their own idea of what metadata to include. Most frameworks offer a listener, reporter, or event hook so you can access results programmatically as they are generated, but those interfaces are also custom to each framework. The result is that consuming test results from more than one framework means writing a bespoke adapter for each one, because there is no common shape to rely on.

What about JUnit XML, is that not the standard?

JUnit XML is the closest thing the ecosystem has to a standard, and it is genuinely useful. It originated in the Java world and became the de facto interchange format that a wide range of frameworks can emit, either natively or through a reporter, which is why so many tools accept it as input.

It has two real drawbacks, though. The first is that the format is loosely defined, so some parser tools fail or behave inconsistently when custom fields are present, because there is no strict agreed schema for anything beyond the basics. The second is simply that JSON has overtaken XML as the common format for data interchange across software generally. Most modern tooling, APIs, and developers reach for JSON first, and XML increasingly feels like a legacy choice. JUnit XML remains a practical lowest common denominator for getting results out of a framework, but it is not a rich or modern format for representing them.

Why use JSON for test results data?

JSON has become the default interchange format for good reasons that apply directly to test results. It maps cleanly onto the data structures developers already work with, it is readable, it is trivial to produce and parse in every language, and it handles nested and custom fields naturally, which is exactly where JUnit XML gets awkward. Test results are inherently structured and often carry extra context (custom fields, parameters, attached files, timing detail) that a rich JSON structure represents comfortably and a rigid XML schema does not. For representing, transmitting, and consuming test results programmatically, JSON is the more natural fit.

What does a standard JSON format for test results look like?

A useful test results format needs to capture the essentials in a predictable structure: the suite a test belongs to, the test name, its result (pass, fail, and so on), and then the richer context that makes results actually useful, such as a failure reason, parameters, timing, and references to attached files like logs and screenshots. The value of standardising this is that any tool consuming the data knows exactly what to expect, rather than reverse engineering a different shape per framework.

As a concrete example of one such format, Tesults defines the Tesults JSON data standard, a JSON format for specifying results output. Every Tesults test framework integration transforms the framework's custom output into this standard JSON, which is then used to transmit results to the Tesults service, and when the Tesults API is used to retrieve results, the same JSON format is returned in the response. It is deliberately simple to understand and implement, and it has been used in production for several years. In the absence of any other common JSON test results format, it is one worked example of what such a standard can look like.

A note for test framework authors

If you author a test framework, offering results output in a well defined JSON format makes your framework easier to integrate with the wider tooling ecosystem, reporting dashboards, CI systems, and analysis tools, without every consumer having to write a custom adapter. There is no universally adopted JSON test results standard yet, so this is still open ground. The Tesults JSON data standard is used across the core Tesults service, its APIs, and its integrations for popular test frameworks, and is available as a reference. If you are a test framework author and have questions or feedback, contact help@tesults.com.

For the full field level specification, see the Tesults JSON data standard documentation, and if you want to get results from your framework into a dashboard, the guide to viewing JUnit XML results in a dashboard covers the practical upload side.

Test automation reporting and failure intelligence

Consolidated test reporting for engineering teams. Store, track, and understand test results across every run and system.

No time limit on free plan

Latest Posts

How to Group and Categorize Failing Tests by Root Cause
How to Group and Categorize Failing Tests by Root Cause
When a CI run shows dozens of failures, label each one with a root cause category and group them to see how many distinct problems you actually have
How to View JUnit XML Test Results in a Dashboard
How to View JUnit XML Test Results in a Dashboard
Upload JUnit XML to a dashboard in one step, and why a test framework library gives you richer reporting with logs, screenshots, and full history
How to Keep a History of Test Results Instead of Losing Them After Each CI Run
How to Keep a History of Test Results Instead of Losing Them After Each CI Run
Why CI logs and artifacts disappear, what you lose when they do, and how to retain a durable history of every test run
How to Query Test Results With AI Agents Using MCP
How to Query Test Results With AI Agents Using MCP
How to query your CI test data failures, flaky tests and regressions with AI agents using the Model Context Protocol
ROS 2 Test Reporting with Tesults
ROS 2 Test Reporting with Tesults
Native support for the full ROS 2 testing stack — C++, Python, Rust, and beyond
Cypress Test Reporting - Beyond the Built-in Reporters
Cypress Test Reporting - Beyond the Built-in Reporters
What Cypress's built-in reporters give you and where they fall short
Playwright Test Reporting: Beyond the Built-in Reporters
Playwright Test Reporting: Beyond the Built-in Reporters
What Playwright's built-in reporters give you and where they fall short
How AI is Transforming Software Testing and Automation
How AI is Transforming Software Testing and Automation
AI is impacting software testing and automation in a big way. Here’s how AI is reshaping the testing landscape.
What is Automated Regression Testing and How to Do It
What is Automated Regression Testing and How to Do It
Learn about what automated regression testing is, how to do it, benefits, why it matters, tooling, reporting and best practices
Guide to API Automation Testing
Guide to API Automation Testing
What is api automation testing, how to do it, best practices and how to report and analyze test results
Test Suite Annotations
Test Suite Annotations
Adding greater context to test reporting
EXP is a test framework that gets out of the way
EXP is a test framework that gets out of the way
Exp test framework