11-12-2008 04:50 PM
11-13-2008 09:32 AM
Anh -
What version of TestStand are you using and what do you mean by "that has Requirement input"? Are you suggesting that the step has a value defined in the Requirement list step property, are you suggesting that the module prototype has some sort of requirement parameter, or does the step type itself somehow define a requirement for each step instance? Being specific about how the requirement value is define will be helpful.
11-13-2008 11:37 AM
Scott,
Our TestStand version is 4.1.
“that has Requirement input” means that the step has our requirement data (some strings) that we type in the Requirement list step property. We type our requirement data in the Requirement list step property for some steps. We don’t type the requirement in the Requirement list step property for every step, but only for some steps. By default, the Requirement list step property field is empty.
We want to log into the database the result of each “Pass/Fail Test” step that has the requirement that we type in the Requirement list step property. If a “Pass/Fail Test” step has an empty value (or no data) in the Requirement list step property, we don’t want to log its result into the database.
Hope this answers your questions.
Thanks.
Anh
11-14-2008 10:50 AM
Hello Anh,
You may find success by looking through the Database Options Dialog Box (Configure»Database Options...). Here you can provide your own Filtering Expression which checks whether Step.Requirements is empty or not. I hope this points you in the right direction!
11-14-2008 11:02 AM - edited 11-14-2008 11:07 AM
There are really two solutions that you have:
Using Callbacks
You could use a model callback to prevent a non-requirement result from being added to the result list in the first place. The downside is that this callback is a sequence that is invoked after every step call, which can affect performance, so I will not discusss this option unless you really want me to.
Using Execution.AddExtraResult
You could force TestStand to add the "Step.TS.Requirements.Links" step array property to every result and then let the database logging feature filter out results that do not have requirements. Memory usage is no different than normal execution and the performance impact is negligible because the engine is doing the copy instead of a callback.
So you need to do two things:
1) Add a call to your process model to instruct the execution to copy the requirements property to the result. This can be done by calling RunState.Execution.AddExtraResult in an expression or using an ActiveX adapter step. The "Setup Result Settings" sequence in the "<TestStand>\Components\Models\TestStandModels\ModelSupport.seq" already does this for some other properties. You could add a step to this sequence by copying the "Step.TS.Requirements.Links" to "Requirements". So now when run with the model, all results will now contain a "Requirements" property that is really the string array of requirements. If no requirements are define, the array is empty.
2) Now you must filter the steps that are logged to database to either sequence call steps or steps that have requirements. You can set the result filtering Expression on the Logging Options tab of the Database Options dialog box. Now there is a bug for TestStand 4.1 with the evaluation of this expression, so
For TestStand 4.1 without the patch, you have to specify the expression as:
PropertyExists("StepResult.Requirements[0]") || PropertyExists("StepResult.TS.SequenceCall")
For TestStand 4.1 with a patch and for other versions of TestStand, you have to specify the expression as:
PropertyExists("Logging.StepResult.Requirements[0]") || PropertyExists("Logging.StepResult.TS.SequenceCall")
(Note sure why the close parenthesis above are showing up as smiley faces on my system)
See TestStand Development System 4.1 - Windows 2000/Vista x64/Vista x86/XP - Patch 123594: Fix for Datab... (http://joule.ni.com/nidu/cds/view/p/lang/en/id/1127) for more information on the patch.
11-17-2008 05:47 PM
11-18-2008 11:01 AM
Anh -
You have a typo in: resultPropertyName” = “Requiements”. You are missing an "r" character.
11-18-2008 11:24 AM
Scott,
I don't have a typo for resultPropertyName in my ModelSupport.seq. It is resultPropertyName = "Requirements"
Thanks
Anh
11-19-2008 12:06 PM
11-19-2008 04:34 PM
Scott,
The ActiveX adapter step that I create in the "Setup Result Settings" sequence in the "<TestStand>\Components\Models\TestStandModels\ModelSupport.seq" calls RunState.Execution.AddExtraResult with
the following 2 parameters (I cut and patse these two parameters here so you will see I have no typo):
- propertyName = "Step.TS.Requirements.Links"
- resultPropertyName = "Requirements"
1. When I run my small test sequence (that I described in my previous message) with
Result Filtering Expression = PropertyExists("StepResult") || PropertyExists("StepResult.TS.SequenceCall")
the result is the step_result table in the database has all three records: one record is for Main Sequence,
one record is for the Numeric Limit Test step having some text in the requirement property,
and one record is for the Numeric Limit Test step having an emtpy requirement property.
2. When I run the same test sequence (as 1. above) with
Result Filtering Expression = PropertyExists("StepResult.Requirements") || PropertyExists("StepResult.TS.SequenceCall")
the result is the step_result table in the database has only one record for Main Sequence.
So, it does not record the Numeric Limit Test step having the requirement.
The my small test sequence uses SequentialModel.seq, by the way.
I wonder if the propertyName = "Step.TS.Requirements.Links" works, because I click on the icon f(x) on the propertyName line in the Module tab of the ActiveX adapter step I created, an "Expression Browser" window appears, I then click on "+Step" under "Variables/Properties" tab, the "Step" expands and shows only "Result". The "Step did not show "TS" as the string of "Step.TS.Requirements.Links" has "TS". So "Step.TS." is not in the "Expression Browser" window, and I wonder if this is ok.
Please let me know what I can fix.
Thanks a lot.
Anh