From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to change step.result.status

Solved!
Go to solution

 

hi,

I don't just remember how I can set the step result status to something else that "passed" or "failed". I know I have done that before but now I can't get it work.

Attached simple sequence file to demonstrate what I'm trying. Text report in my machine looks like this:

 

Begin Sequence: MainSequence
(C:\Temp\status text change test.seq)

Pass/Fail Test:                Skipped
Pass/Fail Test:                Failed
     TEST
Numeric Limit Test:            Failed
     Measurement:              0
     Limits:
        Low:                   9
        High:                  11
     Comparison Type:          GELE (>= <=)

End Sequence: MainSequence

 

Any hint what is missing ?

 

br

Petri

 

0 Kudos
Message 1 of 5
(8,004 Views)
Solution
Accepted by topic author Petri

Petri,

 

http://zone.ni.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/step_execution/ contains list of action a step performs when it is executed.

 

As you can see, Status Expression is evaluated after Post-Expression. Hence, you cannot use Post-Expression to set Step.Result.Status property.

 

Here are couple of options you can try to modify the status of the step:

 

Option 1:

Create custom step type and modify the Status Expression.

 

Option 2:

You can use Post-Step Engine callback to update the result of the step

 

Option 3:

Results of step will be added to Locals.ResultList array. Hence, after executing a step, you can modify the Result container in the array as necessary.

 

- Shashidhar

Message 2 of 5
(7,989 Views)

Thanks Shashidhar for the the link and the comprehensive explanation. I see the execution order.

 

But I'm still confused. Throughout the sequence I have used the multiple numeric limit test which customises the result in post expression. Now I added some numeric limit test and pass/fail test running in to this trouble. Attached sequence where one can see a multiple numeric limit test.

 

Could this behavior be a feature for multiple numeric limit tests ?

Or does the multiple numeric limit test follow some other execution order ?

 

br

petri

 

  

 

 

0 Kudos
Message 3 of 5
(7,981 Views)

Status Expression for multinumeric limit step is empty (which means, Status Expression is not used to set the status of the step). Status for Multinumeric Limit Step is set by the Post-Step substep. Since Post-Expression executes after executing Post-Step substep, updating status of the step in post-expression works well for multinumeric limit step.

 

In the case of pass/fail step or numeric limit step, Status Expression is not empty. Status expression is being used to set the status of the step. Since Status Expression is executed after executing post-expression, setting status of step in post-expression does not work for pass/fail and numeric limit step.

 

You must use one of the option specified above to make it work for all step types.

 

- Shashidhar

Message 4 of 5
(7,979 Views)

thanks for clarification.

br

petri

0 Kudos
Message 5 of 5
(7,970 Views)