NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically set result filtering expression

Solved!
Go to solution

Hi All,

 

Is it possible to set the Configure>>Report Options>>Result Filtering Expression programmatically?

 

I am developing a custom step framework, so I would like to do this without a sequence file callback.

 

Thanks in advance.

Regards,

ace


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 1 of 7
(4,396 Views)

That information is stored in a variable in the Process Model.  If you open the process model and look at either the Test UUTs or Single Pass sequences you will see in the Locals a variable called ReportOptions.  One of the items in that container is called ResultFilterExpression.   So if you can change that then you will be set.

 

You need to follow the flow of the Entry Point to see when that variable is being set.  If you set it before that point it will get overridden.  In fact if you look in the Test UUTs entry point the step called Get Report Options is setting that variable.  Very fitting name for the step I would think.  So at any point after that is when you want to set it.  I recommend doing it through a callback (funny that you didn't want to use callbacks but honestly that is the best way to go for this).

 

Anyhow, hope this helps some.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 7
(4,394 Views)
Solution
Accepted by topic author .aCe.

You can access the filter expression via RunState.Root.Locals.ReportOptions.ResultFilterExpression from anywhere within your sequence.

 

-Jack

Message 3 of 7
(4,379 Views)

Jack,

I don't have access to ReportOptions at all! (Please see below). Unless I am doing something fundamentally wrong.

Using TestStand 2010 Sp1.

Thanks and regards,

aCe 

 

expression.JPG


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 4 of 7
(4,373 Views)

You will only see that at runtime and only if you run via SinglePass or TestUUTs.

Regards
Ray Farmer
Message 5 of 7
(4,371 Views)

Going through RunState.Root is not wise.  Especially when manipulating ReportOptions.  The reason being that ReportOptions are used all throughout the process model.  You would need to verify that the ResultFilterExpression is not being used before MainSequence gets called. 

 

I don't understand why it is so difficult to override the ReportOptions Callback.  It's very purpose in life is to do exactly what you want.  In fact the ReportOptions are handed to it through parameters and then sent back to the Process Model.

 

Step 1: Right Click in your Sequences pane and select Sequence File Callbacks...

Step 2: Select the ReportOptions callback in the list

Step 3: Click the Add button on the upper right corner

Step 4: Click the OK button.  You should now see a green sequence called ReportOptions

Step 5: Select ReportOptions from your Sequences list

Step 6: Place a Statement step in the Main step group

Step 7: Change the name of the statement step to something meaningful

Step 8: Type- Parameters.ReportOptions.ResultFilterExpression = FileGlobals.MyExpression (or wherever you stored it) into the Expression: box

Step 9: Sit back and enjoy your beautiful creation

Step 10: Drink a beer (or other enjoyable beverage)

 

Regards,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 6 of 7
(4,365 Views)

Jack / Ray,

 

Thanks very much for that, that works.

 

Jigg,

Thanks very much for the step by step instructions to add a callback. I am well aware of this, as mentioned in the my original post I would like to do this as a custom step. The idea is to de-skill the process for the test sequence developer, so all of this needs to happen in the background.

 

That said, I will definitely take step 9 & 10 very seriously and follow it to the letter.

 

Thanks once again.

Regards,

aCe


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 7 of 7
(4,346 Views)