DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How to Convert XLS to XLSX in Java
  • Why Testing is a Long-Term Investment for Software Engineers
  • Thread-Safety Pitfalls in XML Processing
  • Loading XML into MongoDB

Trending

  • Recurrent Workflows With Cloud Native Dapr Jobs
  • AI, ML, and Data Science: Shaping the Future of Automation
  • Rethinking Recruitment: A Journey Through Hiring Practices
  • Docker Model Runner: Streamlining AI Deployment for Developers
  1. DZone
  2. Coding
  3. Java
  4. Viewing JUnit XML Files Locally

Viewing JUnit XML Files Locally

In this tutorial, you'll learn how to view the contents of a JUnit XML file locally and read its contents in the form of a table.

By 
Matthew Casperson user avatar
Matthew Casperson
·
Oct. 09, 17 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
26.6K Views

Join the DZone community and get the full member experience.

Join For Free

In order to allow Iridium to be integrated into CI systems, one of the report files that is generated is a JUnit XML file. Almost every CI has a plugin that can parse a JUnit XML file, but sometimes it is nice to be able to view the contents of this file locally.

The trouble is that this file is not that easy to read in its raw form. You can find what you need if you dig into the format, but I’d still rather have this information presented in a nice table.

Fortunately, there are some open source tools you can use to quickly browse the contents of a JUnit XML file.

First, you will need a JUnit XML file to view. Install Java 8, download the WebStart file from this link and run the file to execute a simple test. The results of the test will be saved to ~/WebAppTestingReports/<yyMMdd>/MergedResults.xml. You should see a file like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testsuite failures="0" skipped="0" tests="1" time="56.422665">
    <testcase classname="Google Test" name="1: Launch Google" time="56.422665">
        <system-out>Given I open the page "https://google.com"..................................passed
When the element found by "Google Search" is present........................passed
Then the browser title should be "Google"...................................passed
</system-out>
    </testcase>
</testsuite>

Then you will need to install junit-viewer, which is built on top of NodeJS. This app will convert the JUnit XML file into HTML.

sudo npm install junit-viewer -g

Next, you need to install bcat, which is a Ruby Gem that can be used to pipe HTML directly to the browser.

sudo gem install bcat

Finally, these two tools can then be combined to display the JUnit XML file directly in the browser. 

junit-viewer --results=MergedReport.xml | bcat

Image title

If you are interested in writing end-to-end tests like the one shown above, check out the Iridium documentation, and take a look at the course on Udemy. Iridium itself is a free and open source project on GitHub.

XML JUnit

Opinions expressed by DZone contributors are their own.

Related

  • How to Convert XLS to XLSX in Java
  • Why Testing is a Long-Term Investment for Software Engineers
  • Thread-Safety Pitfalls in XML Processing
  • Loading XML into MongoDB

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!