NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programably changing TestStand Report File Path Directory

I would like to save my passed module reports in one directory and my failed module reports in another. How can I change the TestStand Report file paths based on pass or fail?
0 Kudos
Message 1 of 3
(5,038 Views)
I noticed that this question was unanswered,so I thought that I'd give you an idea, or at least the way that I found worked for the problem that I had.

What I wanted to do was to rename the Report files to preceed the filename with the number of Errors such as:
Process Alarm Test.html
rename the failed test with 2 errors to:
2-Process Alarm Test.html

For me it got a bit complicated in that I also wanted to make sure that each test was named for the test that was running. This required a series of things which in your case may also apply. My concern here is that your Report must be closed (completed) in order to move it.

1. Your top level Sequence should have the Model set to None. This allows each Subsequence call to create a Report, and therefor, when complete, it will close the file.

2. Each subsequence call from the Main sequence must be set to "Run in a New Execution", and the Settings tab must be set to Wait for Execution to complete "Before executing next step". You will also want to set your Model to either a specific Model, or the Process Model of the specified Client (file). I also found that I needed to add "RunState.Execution.TypeMask.Value to the Additional Execution Type Mask Settings to allow the "Break on failure in New Executions" to work correctly.

3. You'll then need to add a SequenceFilePostStep callback to the top level sequence. In this sequence you'll need to add a step that will rename (or in your case MOVE the file. But you'll also need a precondition set to
RunState.Caller.RunState.StepGroup == "Main"
so that it doesn't try to rename files from the Setup or Cleanup steps.

4. Then, somewhere in your subseqence test, you need to set a varaible (I used a StationGlobal, you could use a Parameter if you like) to indicate the report filename:
StationGlobals.sReportFileName =
RunState.Root.Locals.ReportFilePath

I've attached a file that hopefully will show you how I did most of this.

I'm sure that there are other ways of doing this, but because of some of my requirements, this was the solution that worked for me.

Mike
0 Kudos
Message 2 of 3
(5,038 Views)
In reponse to moto2labview's original question of modifying the Report File Path based on the result of a UUT,

TestStand 4.2 gives you the ability to specify the report path using Expressions as well right from the Report Options dialog box. For instance, using the  

<UUTStatus> macro, you could specify that reports for UUTs that Pass versus those that Fail go to different locations.

For more information on this, refer to:
NI TestStand Help: Specifying Report File Paths by Expression
NI TestStand 4.2 Release Notes: Using Expressions to Customize Report File Paths

 

For more information on the new features in TestStand 4.2, refer to:
Whats New in TestStand 4.2

Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 3 of 3
(4,558 Views)