Example Code

Converting TestStand Sequence Analyzer reports to JUnit

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Teststand

    Operating System

  • Windows

    Other

  • Sequence Analyzer

Code and Documents

Attachment

Description

Overview

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

 

Description

This example stylesheet can be used to convert TestStand Sequence Analyzer results to a JUnit format compatible with the Jenkins JUnit plugin. This allows users to view basic analyzer results in Jenkins:

pastedImage_1.png

 

This example stylesheet was written for TestStand 2016 - to use it with a different version of TestStand, modify the PropertyObjectFile stylesheet version reference:

 

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ts="http://www.ni.com/TestStand/19.0.0/PropertyObjectFile" exclude-result-prefixes="ts">

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. Run the TestStand Sequence Analyzer and save the generated XML report.
  3. Run the following command in the Windows command prompt:
    msxsl <path to analyzer 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.