NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Removing a test from the resultlist

I have a handful of individual test steps that I only want to output in the report if they are failing.  Evaluating Step.Result.Status=="Passed" seems to be the way to detect if the test step is passing.  From searching older posts it looks like I want to remove the last entry in the Resultlist.  I have tried RemoveElements(Locals.Resultlist, "[0]", 1) as a Post Expression and as part of a Post Action custome condition.  I also looked at using GetNumElements(Runstate.Caller.Locals.Resultlist) in place of the index "[0]".  These statements do not change the report output in any way.  
Am I getting this all wrong?  Do I have to wait for the step to complete to be able to alter the Resultlist (maybe from a post step callback which will require finding a way of keeping track of which steps need to be removed from the Resultlist).  Or is there a easier way such as manipulating Step.TS.NoResult.  I also saw a reference to Parameters.DiscardResult in a post, but could not find a reference to it in any documentation.     
0 Kudos
Message 1 of 11
(5,232 Views)

Hi mvr,

You need to use the Callback such as SequenceFilePostResultList.

This will allow you to discard result of the Step.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 11
(5,226 Views)

Thanks for the reply Ray.

Not exactly the answer I wanted since now I will need to find a way to detect which steps do not need to be recorded from inside the callback, but lets see how far I can get with this method.  I located the discardresult.seq example at http://zone.ni.com/devzone/cda/epd/p/id/4744.  When I run this sequence it behaves as described deleting all but the failing results for example test steps.  That is until we enable "on the fly" report generation for an xml report format.  At that point all the test steps are once again logged to both the display and the report file.  Does anyone know why this would happen?  My Teststand version is 3.5.

0 Kudos
Message 3 of 11
(5,212 Views)

Hi,

have you tried following the link that you provide to http://digital.ni.com/public.nsf/websearch/93AA5CF5380F8D5986256F050059A440?OpenDocument

which is filtering result for xml report.

regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 11
(5,206 Views)
Clicking on the link for "Modification of Result Collection" at the bottom of the page you linked takes me to the same discardresult.seq example that I am running.  I set a breakpoint in the SequenceFilePostResultListEntry callback and it does execute and set Parameters.Discard to True, but with on the fly reporting enabled the test step result still prints to the report files. 
0 Kudos
Message 5 of 11
(5,203 Views)

Oops,

If you have the Discard Results or Disable Results When Not Required, to converse memory, its possible that the Engine callback SequenceFilePostResultListEntry is not called.

Regards

 

Regards
Ray Farmer
0 Kudos
Message 6 of 11
(5,197 Views)
The conserve memory option is not available when using the xml format.  I tried executing the discardresults.seq using the HTML format.  The results are the same with conserve memory enabled or disabled.  When On the Fly is enabled, all test step results are output to the report.  Again, the callback is being executed as I can break on the callback.  The report generator is acting differently when On the Fly is enabled.
0 Kudos
Message 7 of 11
(5,189 Views)
Hi mvr,

There is a callback in your process model called ProcessModelPostResultListEntry. If you place additional preconditions on the first two steps so that it checks for a failed step before executing (Parameters.Step.Result.Status == "Failed") you'll find that even with On-The-Fly reporting enabled, only your failed steps will find their way into the report.

Keep in mind, since you are modifying the process model, make sure to make a copy of the default NI process model and copy it to the Users directory:

C:\Program Files\National Instruments\TestStand 3.5\Components\Users\Models\TestStandModels

This change will affect any sequence on the machine that uses this process model.

Hope this helps. Have a good one!

Dan Weiland
Applications Engineer
National Instruments
Dan Weiland
0 Kudos
Message 8 of 11
(5,138 Views)
Thanks for the reply Dan.  Changing ProcessModelPostResultListEntry in the process model does change the behavior of the discardresult sequence to be the same with or without "on the fly" enabled.  While I still need to modify the behavior so that I can select which "passing" steps are not output to the report at least I have a model to work from.  I had worked out a method for discarding the results of an individual step using the SequenceFilePostResultListEntry callback but now must expand that to pass the request back to the process model. 
This has grown a bit more complicated than just a simple filter statement to remove the last entry from the resultlist.  It may have been simpler to implement by removing the last entry in the ResultList than to try and use the Parameters.Discard variable.
 
0 Kudos
Message 9 of 11
(5,125 Views)

Hi,

I am surprised that you have it working with ProcessModelPostResultListEntry and not with the SequenceFilePostResultListEntry. I wonder whats going on there.

Glad you have a solution.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 10 of 11
(5,111 Views)