11-14-2011 09:11 AM
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
Solved! Go to Solution.
11-14-2011 10:03 AM
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.
11-15-2011 07:22 AM
You can access the filter expression via RunState.Root.Locals.ReportOptions.ResultFilterExpression from anywhere within your sequence.
-Jack
11-15-2011 11:59 AM
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
11-15-2011 12:22 PM
You will only see that at runtime and only if you run via SinglePass or TestUUTs.
11-15-2011 01:45 PM - edited 11-15-2011 01:46 PM
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,
11-16-2011 04:29 AM
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