02-06-2018 01:33 PM
Using a Numeric Limit Test in TestStand, and in the Post-Expression I have the following:
Step.Result.ReportText = Step.Result.Status == "Passed" ? "" : Step.Result.ReportText + Str (Step.Result.Numeric),
FileGlobals.ErrorMessage = Step.Result.ReportText
I have the Step.Result.ReportText being read in a property loader with no issues.
However, I figured if the Step.Result.Status was equal to "Passed", the expression would set the Step.Result.ReportText to null and not report anything. I've stopped the step and verified the Status is Passed, but it continues to report the message loaded.
Solved! Go to Solution.
02-07-2018 02:46 AM
I believe this will be due to the order in which the actions forming the step are performed. Looking at Step Execution in the TestStand 2016 Help, it indicates that the post-expression is evaluated before the status expression. This will mean that the Step.Result.Status value will not be available at the time the post-expression is evaluated.
02-07-2018 02:49 AM - edited 02-07-2018 02:49 AM
Hi sdrochek3
In TestStand the PostExpression is carried out before the StatusExpression which is what populates Step.Result.Status. When your PostExpression executes Step.Result.Status will be an empty string (!= "Passed") so it always hits the failed element of your conditional operator.
Steve
08-05-2022 03:48 AM
Try the following in the post-expression:
Evaluate(Step.TS.StatusExpr) == "Passed" ? ("Do the Passed-Thing"):("Do the Not-Passed-Thing")
The status-expression is evaluated now in post-expression as well.