NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

restrospectively skip a test

I have a test where a dialog is displayed to the user.  If the user presses cancel then no changes are made and I would prefer the test to show up as having been skipped.  Is there a way to make the test show as skipped after it's been run?  I tried setting Step.Result.Status = "Skipped" from within the test but it still shows as passed/failed afterwards.
 
Having another dialog prior to the test is undesireable because the user may not know that the want to cancel until they start trying.
 
 
0 Kudos
Message 1 of 3
(3,165 Views)
Sam,
 
You could use the SequenceFilePostResultList callback. This sequence is callback on every step therefore it gives you the opportunity to modify the Results of the step that has just been performed.
 
In SequenceFilePostResultList callback you can set the Parameters.Step.Result.Status = "Skipped" depending on whether your user pressed cancel or not. (Remember its the Result in Parameters.Step.Result not Parameters.Result)
 
Trouble is the SequenceFilePostResultList is called at every step therefore you need to pass some boolean into the SequenceFilePostResult sequence so you can use it as a Precondition on whether to set Parameters.Step.Result.Status to "Skipped" or leave it as it is. Otherwise every Step's Status will get set as "Skipped".
 
There are several ways.
1). In your Sequence (not the SequenceFilePostResultList sequence) you could use a Local (eg Locals.toSkip) then if the user presses cancel you would set Locals.toSkip = True.
If you also set the this local (Locals.toSkip) to "Propagate to Subsequence" (you will find this setting by selecting the variable in the Locals window and pressing right mouse click, then select Propagate to Subsequence). This variable will appear in the Sequence SequenceFilePostResultList at runtime, therefore you can use it in the Precondition of a step that sets Parameters.Step.Result.Status = "Skipped".  This local will not be available at edit time in SequenceFilePostResultList therefore it will not show up when you browse the SequenceContext.
2) In SequenceFilePostResultList you could look back to the caller and check what the value of your local is by using the lookup string
"RunState.Caller.Locals.toSkip".
3) You could use a Global variable either in StationGlobals or FileGlobals.
 
Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 3
(3,156 Views)
It works!  Thanks very much for the quick reply.
0 Kudos
Message 3 of 3
(3,138 Views)