NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

passed test when failed step

Solved!
Go to solution

Hi

I have a step with Numeric Limit test. 

In Properties under Run Options I have checked Step Failure Causes Sequence Failure

But when I got failed on the step, the test result is passed.

When I change Post Actions - On Fail from Goto next step to Goto cleanup 

then the test result gets failed.

 

I have two other stations where I have numeric limit test with the same Properties but there I do not have to go to CleanUp to get a failed result.

 

I use TestStand 2013.

 

Please help me, Thanks

/Magnus

0 Kudos
Message 1 of 5
(4,754 Views)

Hey Magnus,

 

The fact that changing the Post Action to goto cleanup after a Failed result causes this to work properly suggests that you might have something farther down in your sequence that is changing the sequence result. Is it possible that you have an expression or code in a code module that is changing the RunState.SequenceFailed property? Perhaps this code is after your step which is not working properly, but before the other Numeric Limit steps that do cause the test result to fail.

0 Kudos
Message 2 of 5
(4,738 Views)

Thank you Daniel for you reply,

 

I think you are right,

I have a popup messeage that ask the operator if a value is correct

and if it is not the operator press NO and the test should fail.

BUT when they press OK I think it overwrites the failure before.

 

In the Post-Expression:

RunState.SequenceFailed = (Step.Result.ButtonHit == 1 ? False:True)

 

In Status Expression

Step.Result.ButtonHit == 1 ? "Passed" : "Failed"

 

/Magnus

0 Kudos
Message 3 of 5
(4,730 Views)
Solution
Accepted by topic author MicroMange

Magnus,

 

Instead of setting RunState.SequenceFailed in your Post-Expression, try setting Step.Result.Status to that value instead. This worked on my machine.

 

Hope it helps!

0 Kudos
Message 4 of 5
(4,723 Views)

Thank you for your help Daniel,

 

Now it works when I write the value to Step.Result instead.

But I noticed that I do not need to have anything in Post-Expression at all, just my string in Status-Expression.

I do not remember why I put something there from the start.

 

/Magnus

0 Kudos
Message 5 of 5
(4,706 Views)