You can customize report generation within TestStand in a variety of ways. You can also create a custom results format by creating a custom result processing plug-in.

Note Completed solution files are located in the <TestStand Public>\Tutorial\Solution directory.

Configuring Test Report Options

Complete the following steps to configure the test report options.

  1. Open <TestStand Public>\Tutorial\Computer.seq.
  2. Select Configure»Result Processing to launch the Result Processing dialog box.
  3. Click the icon in the Options column for the built-in Report model plug-in to launch the Report Options dialog box and complete the following steps.
    1. On the Contents tab, select ATML 6.01 Standards Report Document from the Report Format ring control.
    2. Enable the Include Step Results option and confirm the following step result settings:
      • Enable the Include Test Limits option.
      • Enable the Include Measurements option.
      • Select Insert Graph from the Include Arrays ring control.
    3. Click the Edit Format button located to the right of the Default Numeric Format control to launch the Numeric Format dialog box, in which you specify the format TestStand uses to display the value of a numeric variable or property. By default, TestStand configures the numeric format to report numbers with 13 digits of precision.
    4. Change Maximum Number of Significant Digits to 2 and click OK to close the Numeric Format dialog box.
  4. Click the Report File Pathname tab, which you use to specify the report file pathname. You can specify a fixed pathname to use for all report files or you can specify options the report generator uses to generate report file pathnames. Use the default values for the options on this tab and click OK to close the Report Options dialog box.
  5. Click OK to close the Result Processing dialog box.
  6. Select Execute»Test UUTs. Run through several iterations of the sequence, selecting components other than the Video and CPU tests to fail.
  7. Click Stop in the UUT Information dialog box to stop sequence execution. The test report contains failure chain information for UUTs that fail. The failure chain shows the step failure that caused the UUT to fail and shows the Sequence Call steps through which the execution reached the failing step. Each step name in the failure chain links to the section of the report that shows the result for the step.
  8. Close the Execution window.
  9. Select Configure»Result Processing to launch the Result Processing dialog box.
  10. Click the icon in the Options column for the built-in Report model plug-in to launch the Report Options dialog box and complete the following steps.
    1. Click the Contents tab and select ASCII Text File from the Report Format ring control.
    2. Select Exclude Passed/Done/Skipped from the Result Filtering Expression ring control for TestStand to apply a filtering expression to determine what steps appear in the report. In this example, you configure TestStand to record only the results of the steps that do not pass or steps that complete without any status. TestStand also changes the value of the Include Arrays ring control to Insert Table because ASCII reports do not support graphs.
  11. Click OK to close the Report Options dialog box, and click OK to close the Result Processing dialog box.
  12. Repeat steps 6 through 8 and examine the text version of the test report. Close the Execution window when you finish reviewing the report.

Using External Report Viewers

You can view the test report in external applications more suited for showing and editing text, such as Microsoft Word or Microsoft Excel.

Complete the following steps to use an external report viewer to view the test report.

  1. Select Configure»External Viewers to launch the Configure External Viewers dialog box.
  2. Click the Add button.
  3. Click the Browse button located to the right of the Viewer control and navigate to the application you want to use to view the report, such as Word, and click OK.
    Note When you select the application you want to use and click OK, TestStand might launch the File Not Found dialog box because TestStand cannot locate the file within the default TestStand search directories, which TestStand uses to resolve relative paths to code modules and other files or directories. Select the Use an absolute path for the file you selected option to ensure that TestStand can access the application you want to use to view the report, and click OK to close the File Not Found dialog box.
  4. Select txt from the Format pull-down menu.
  5. Enable the Automatically Launch Viewer option.
  6. Click OK to close the Configure External Viewers dialog box.
  7. Select Execute»Test UUTs. Run through several iterations of the sequence, selecting components other than the Video and CPU tests to fail.
  8. Click Stop in the UUT Information dialog box to stop sequence execution. TestStand generates the text report and launches the external viewer application you configured in step 3 to show the test report.
  9. Examine the test report and close the external report viewing application.
  10. Close the Execution window.
  11. Complete the following steps to change the report settings back to the default settings.
    1. Select Configure»Result Processing to launch the Result Processing dialog box.
    2. Enable the Show More Options option.
    3. Click the Reset to Defaults button.
    4. Click OK in the Reset Configuration prompt.
    5. Click OK to close the Result Processing dialog box.
  12. Complete the following steps to change the external viewer settings back to the default settings.
    1. Launch the Configure External Viewers dialog box.
    2. Select the external viewer application you configured in step 3 and click the Delete button.
    3. Click OK to close the Configure External Viewers dialog box.
  13. Close all the windows in the sequence editor.

Adding Additional Results to Reports

Use the Additional Results panel to add and configure additional results, which are values TestStand adds to the result list of a step when the step executes. An additional result can be a module parameter or a custom additional result in which you specify the name and value of the result. You can configure TestStand to automatically include additional results when generating a report or when logging results to a database. The default TestStand report generator style sheets do not display additional results for skipped steps.

Complete the following steps to create a step that calls a DLL code module to return a numeric array and add the numeric array and other values to the report.

  1. Select File»New»Sequence File to open a new sequence file.
  2. Save the sequence file as CustomReport.seq in the <TestStand Public>\Tutorial directory.
  3. Complete the following steps to create a local variable.
    1. Click the Variables pane in the Sequence File window, right-click the Locals item and select Insert Local»Array of»Number from the context menu to launch the Array Bounds dialog box, in which you can modify the array bounds.
    2. Enter 49 in the Upper Bounds control and click OK.
    3. Rename the local variable NumArray.
  4. Click the C/C++ DLL adapter icon, as shown in the following figure and located at the top of the Insertion Palette.
  5. Insert an Action step in the Main step group and complete the following steps to configure the Action step.
    1. On the Module tab of the Step Settings pane, click the Browse button located to the right of the Module control, navigate to <TestStand Public>\Tutorial\NumericArray.dll, and click Open.
    2. Select GetNumericArray from the Function ring control.
    3. In the Value Expression column of the measurements parameter in the Parameters Table, enter Locals.NumArray to copy the value from the numeric array output parameter to the Locals.NumArray variable when TestStand returns from calling the GetNumericArray function.
    4. In the Value column of the Dim 1 Size property in the Parameter Details Table located to the right of the Parameters Table, enter -1 to specify that TestStand passes all elements of the Locals.NumArray property to the code module.
  6. On the Properties tab of the Step Settings pane, complete the following steps to add the numeric array and other values to the report.
    1. Click Additional Results to show the Additional Results panel.
    2. Place a checkmark in the measurements [Out] parameter checkbox to log the output value of the parameter.
    3. Click the Add Custom Result button to add a new empty row to the list of the results.
    4. Enter "Time", including the quotation marks, in the Name column and enter Time() in the Value to Log column. The Time TestStand expression function returns the current time.
    5. Click the Add Custom Result button again.
    6. Enter "Date", including the quotation marks, in the Name column and enter Date() in the Value to Log column. The Date TestStand expression function returns the current date.
  7. Save the changes you made and select Execute»Single Pass. Review the report that includes the array data, the time, and the date.
  8. Close all the windows in the sequence editor.

Adding to Reports Using Callbacks

Complete the following steps to add a logo to the header of the HTML report using a Report callback in the process model.

  1. Open <TestStand Public>\Tutorial\Computer.seq.
  2. Select File»Save <filename> As and save the sequence file as Computer7.seq in the <TestStand Public>\Tutorial directory.
  3. Select Configure»Result Processing to launch the Result Processing dialog box.
  4. Click the icon in the Options column for the built-in Report model plug-in to launch the Report Options dialog box and complete the following steps.
    1. On the Contents tab, select HTML Document from the Report Format ring control.
    2. Click OK to close the Report Options dialog box, and click OK to close the Result Processing dialog box.
  5. Select Edit»Sequence File Callbacks to launch the Sequence File Callbacks dialog box, select the ModifyReportHeader callback, and click Add to add the callback to the sequence file.
  6. Click Edit to close the Sequence File Callbacks dialog box and edit the new ModifyReportHeader callback sequence in the Sequence File window, which TestStand automatically opens.
  7. Click the Variables pane, right-click the Locals item, select Insert Local»String from the context menu, and name the local variable AddToHeader. Click in the Value column of the AddToHeader variable and enter the following text:
    <img alt='Logo Goes Here' src='Logo.jpg'><br><br> <a href='http://www.ni.com'>Visit Our Website</a><br><br>
  8. Insert a Statement step in the Main step group and rename the step Add Custom Logo.
  9. On the Expression tab of the Step Settings pane, enter the following expression in the Expression control:
    Parameters.ReportHeader = Locals.AddToHeader + Parameters.ReportHeader
    Click the Check Expression for Errors button to verify that the expression contains valid syntax.
  10. Save the changes and select Execute»Single Pass.
  11. Click Done in the Test Simulator dialog box. Review the report after the execution completes and notice the new logo image at the top of the UUT report.
  12. Complete the following steps to change the report settings back to the default settings.
    1. Select Configure»Result Processing to launch the Result Processing dialog box.
    2. Enable the Show More Options option.
    3. Click the Reset to Defaults button.
    4. Click OK in the Reset Configuration prompt.
    5. Click OK to close the Result Processing dialog box.
  13. Close all the windows in the sequence editor.