Using Counters and Custom Reports

Last Updated: Feb 20, 2013

RE: Driver Counter Commands , Counter Functions (RRAFS Only) , Logging Function (RRAFS Only)
(SAFS Counter Functions and Logging Functions are exposed via the 'Counter Commands').


The availability of Counters is intended to support the need for evaluating the success or failure of user-defined features, requirements, specification, or any kind of "thing" the user wants to identify. Counters are not restricted to table boundaries. A Counter can be started, stopped, and suspended at any time, in any table, and different Counters can overlap.

This enables us to capture information identified by application feature, requirement, or specification.

Currently, SAFS provides many Counter Driver Commands in support of user-defined Counters.
(RRAFS Robot scripts also have access to the same capabilities through functions in ApplicationUtilities and LogUtilities.)

In general, you provide a unique ID or name for each Counter to get it started when appropriate for your needs. For example, starting a Counter named "EaseOfUse" to keep track of only those tests or records satisfying a specific Requirement of the same name :)

You can subsequently suspend, resume, and stop that Counter and capture the accumulated information into DDVariables, act on those values, or simply log it directly to the log with LogCounterInfo.


Post-processing XML Logs for Custom Reports

SAFS supports output of an XML log when the XMLLOG flag is present in the LogMode setting of the test configuration INI file, as shown in the example setting below:

When Counters are combined with the XML logging capabilities, it is easy to generate custom reports or data based on the results accumulated in the Counters.  These reports can be targetted for each Feature, Requirement, or Specifications for which you implemented a special Counter. 

A *very* simple example:

See the complete simple HTML summary report transformed from an XML log that tracked a few odd items.  As a side note, the same log, and the information for these items, can also be transformed into custom database formats used for Defects, 3rd party reporting, or whatever is needed.

If you have installed the SAFS Framework, then you will find some sample Log Transforms in:

    \SAFS\Samples\Log Transforms directory.

For example, there should be sample transforms for:

    Simple Summary  (simplesummary.xsl)
    Failure Summary (failuresummary.xsl)
    SAFS 2 JUnit    (tc2junit.xsl)

After the test is completed, you apply the desired transform(s) to the XML log.  SAFS provides MSXSL.EXE in the SAFS\bin directory as one possible means to perform XML transforms.

An example of performing such a transform using MSXSL from the command-line would be something like below:
(Of course, you would have to use the full paths to the XML and/or XSL files if they are not in the current working directory.)

The above example assumes that both the TIDTest.SAFS.xml XML test log and the simplesummary.xsl XSL transform file are in the same current working directory.

Hopefully, this is enough to get you to explore the possibilities of user-defined Counters and XML Log transformations for Custom Reports.