NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I globally log into the database the results of interested step types?

Hello, We would like to globally log into the database the results of the following step types:- NumericLimitTest- MultipleNumericLimitTest- Pass/Fail Test that has Requirement input.We don’t want to log into the database other step types’ results. We don’t want to set the Record Results step property to False for each step that we are not interested in logging, and set it to True for each step that we are interested in logging because our sequence files have too many steps and sequence calls. How can we globally log into the database the above step types? Thank you, Anh Doananh.t.doan@boeing.com

 

0 Kudos
Message 1 of 13
(4,553 Views)

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.

 

 

Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 13
(4,542 Views)

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

0 Kudos
Message 3 of 13
(4,539 Views)

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!

 

 

Rod T.
0 Kudos
Message 4 of 13
(4,526 Views)

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.

Message Edited by Scott Richardson on 11-14-2008 11:07 AM
Scott Richardson
https://testeract.com
Message 5 of 13
(4,525 Views)
Hi Scott, I followed your direction of "Using Execution.AddExtraResult", but it only logged into the database the sequence call.  It did not log into the database any step that has, or does not have a requirement property. What I did are:1. I add an ActiveX adapter step to the "Setup Result Settings" sequence in the "<TestStand>\Components\Models\TestStandModels\ModelSupport.seq"This step calls RunState.Execution.AddExtraResult, one of its parameter names is “propertyName” = "Step.TS.Requirements.Links" , and another parameter name is resultPropertyName” = “Requiements”.  This step has an empty Preconditions property. 2. In Configuration | Data Options | Logging Options | Result Filtering Expression field, I typed in:   PropertyExists("StepResult.Requirements[0]") || PropertyExists("StepResult.TS.SequenceCall") 3. I created a small test sequence to test this.  The sequence has a Main Sequence.  The Main Sequence has two steps.  The first step is a Numeric Limit Test step having an empty requirement property.  The second step is a Numeric Limit Test step having some text in the requirement property.   I ran this test sequence.  The result is the step_result table in the database has only one record for the Main Sequence.   There is no record in the step_result table for the Numeric Limit Test step which has the requirement.   I use MySQL 5.0, by the way. Please let me know what I need to do to log the Numeric Limit Test step that has some text in the requirement property. Thanks a lot. Anh
0 Kudos
Message 6 of 13
(4,478 Views)

Anh -

You have a typo in: resultPropertyName” = “Requiements”. You are missing an "r" character.

 

Scott Richardson
https://testeract.com
0 Kudos
Message 7 of 13
(4,456 Views)

Scott,

 

I don't have a typo for resultPropertyName in my ModelSupport.seq.  It is resultPropertyName = "Requirements"

 

Thanks

 

Anh 

0 Kudos
Message 8 of 13
(4,453 Views)
I tried this again on my system and it works as expected. Are you sure that the property naming is the same? Are you still seeing the problem? Can you change the PropertyExists("StepResult.Requirements[0]") portion of the expression to PropertyExists("StepResult.Requirements") or even just PropertyExists("StepResult") to see that you do get all results again. Then we know that the problem is a mismatch in the naming.
Scott Richardson
https://testeract.com
0 Kudos
Message 9 of 13
(4,431 Views)

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

0 Kudos
Message 10 of 13
(4,421 Views)