Example Code

Converting TestStand XML Reports to JUnit

Code and Documents

Attachment

Overview

TestStand XML reports can be converted to other formats using eXtensible Stylesheet Language Transformations (XSLT). This can be useful for importing Test Results into a tool that is not compatible with the TestStand XML report schema.

 

Description

This example takes a TestStand XML report and converts it to a JUnit report format compatible with the Jenkins JUnit plugin. This allows users to view test results in Jenkins:

 

pastedImage_10.png
 

Note: This example stylesheet only converts basic test result data into JUnit - such as Step Name, Step Status, and Error Message. This stylesheet can be modified to include additional failure information for specific step types.

 

Hardware and Software Requirements

NI TestStand

Command Line Transformation Utility (msxsl.exe)

Steps to Implement or Execute Code

  1. Download the attached stylesheet and msxsl.exe from Microsoft.
  2. Generate a TestStand XML Report using the report plugin.
  3. Run the following command in the Windows command prompt:
    msxsl <path to test report> <path to example stylesheet> -o <path to output xml file>
https://www.linkedin.com/in/trentweaver

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Sanad
Member
Member
on

Hi,

I have tried to generate xml file as mentioned in "https://forums.ni.com/t5/Example-Programs/Converting-TestStand-XML-Reports-to-JUnit/ta-p/3689131?pro...", but I am not able to see this in Jenkins. Am I missing anything?

Result.png

 

Thanks,

Sanad MM

Sanad
Member
Member
on

It was configuration issues and fixed. Not able to delete above message, please discard.

Thanks,

Sanad MM

KrithiSam
Member
Member
on

Hey,

I am having a problem converting the TestStand XML reports into JUnit XML report.  for the command 

msxsl "C:\Users\joshikak\Downloads\outputs\Sample Test_Old_Report[19 30 48][10 06 2019].xml" "C:\Users\joshikak\Downloads\ATML_JUnit_Simple.xsl" -o C:\Users\joshikak\Downloads\output

I got an error saying

'msxsl' is not recognized as an internal or external command,
operable program or batch file.

I don't know how to proceed.

 

Thanks in advance

WireWeaver
Active Participant
Active Participant
on

Calling msxsl directly in the command prompt will not work unless it's included in your PATH environment variable. You need to make sure that you're specifying the entire path to wherever you put the msxsl.exe, or a relative path to your working directory.

https://www.linkedin.com/in/trentweaver
Ajay_MV
Active Participant
Active Participant
on

Any of ended up like this?  Two "testsuite" generated under single file?

Ajayvignesh_MV_0-1592848802596.png

 

Well I had run the test sequence in parallel model with ATML 6.0 report generation for this purpose.  Surprisingly I saw single report generated from TestStand for two test socket.  I thought it's fantastic as I don't need to parse two file with his msxsl.  But Jenkins couldn't recognize this second testsuite in single file and causes below error.

 

Ajayvignesh_MV_1-1592849047750.png

 

I'm looking for changing any ATML config to generate two xml report files instead of one so that I can overcome this.. Has anyone faced this in parallel model and have good practice already?

 

Thanks,

Ajay.

 

--
Ajay MV


Ajay_MV
Active Participant
Active Participant
on

I changed the parallel model config to overcome my previous problem. 

Generate separate reports for each test socket and modify the batch file iterate through each files with msxsl parser.

Ajayvignesh_MV_0-1592906678304.png

Ajayvignesh_MV_1-1592906765625.png

 

 

--
Ajay MV


Contributors