NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get "Result Filtering Expression" Selected Value in my Sequence?

Hello

I need to implement a conditional statement(? 🙂 in an expression for one of my step in a sequence.
This conditional statement would be checking "Result Filtering Expression" value set earlier in "Report options".
It will be helpful if i can get this "Result Filtering Expression" value by some property which i can check in my conditional statement.

Regards
Nitin Goel

0 Kudos
Message 1 of 7
(4,394 Views)
Nitin,

RunState.Root.Locals.ReportOptions.ResultFilterExpression is the runstate property you are looking for...

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(4,393 Views)
I also would like to set the Result Filtering Expression in my sequence, but I cannot see "RunState.Root.Locals.ReportOptions.ResultFilterExpression". I can only see up to RunState.Root.Locals. That is "ReportOptions" is missing from my Locals object. Interestingly RunState.Root.Locals seems completely empty. What am I doing wrong?
 
Note that I am attempting to edit the result filtering expression in a 'Statement' step type.
 
Ben
0 Kudos
Message 3 of 7
(4,381 Views)
Ben,

the given property is a "runstate" property, so it exists only during runtime. If you want to look at the current value, you have to insert a breakpoint in your sequence and execute it. When hitting the breakpoint, switch to the variable-view and search for the property..... Note that the value can differ for every execution!

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 7
(4,357 Views)

Hi Norbert,

Thanks for coming back to me. Yes that would make sense now...

Is this property mentioned read only? I would like to set it in different parts of my test to change the reporting method for different sub-sequences and hope that this property will allow me to do that.

Regards,

Ben

0 Kudos
Message 5 of 7
(4,353 Views)
Ben,

i doubt that this will work out the way you are looking for. There is maybe only one way to accomplish that: On the fly reporting.
Further, please note that some XML reportformats does not honor that setting, so you have to use one of the other reportformats.

The main reason that only on the fly reporting possibly could supply you with the desired functionality is, that TS collects the results in the ResultList and after the whole execution of your MainSequence (including all its subs!) is finished, the processmodell creates the report. And in this step, it does not matter, how often and when you changed the filtersettings. It will only honor the last setting and this will be applied to the whole report.....

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 7
(4,337 Views)

Hi Norbert,

In the end I decided against using on-the-fly reporting as I noticed when I used it before that the layout of the report was not the same as the final report. However I did not give it an extensive try so I could be incorrect here.

Instead I found that I could use the report options callback to set the following:

Parameters.ReportOptions.ResultFilterExpression = "(Result.TS.StepType == \"SequenceCall\") || (Result.TS.StepType == \"Label\") || (Result.TS.StepType == \"Action\") || (Result.TS.StepType == \"NumericLimitTest\" && Result.Status == \"Failed\")"

With this I found that I could control the reporting to the level that I required.

Many thanks for your help.

Ben

0 Kudos
Message 7 of 7
(4,243 Views)