09-30-2015 10:43 AM
I'm trying to get a While Loop step to throw a Pass/Fail.
Basically we want to loop on some steps a max of 'X' number of times.
If the Loop condition goes False before the set number of iterations, we want the step to Pass.
If not, we want it to Fail.
It's a Loop Timeout based on the loop counter.
I've created a custom While Loop step with the Status Expression enabled so we can build an expression.
For testing, the While Loop Condition is simply "RunState.LoopIndex < 10"
The Status Expression is "RunState.LoopIndex == 10 ? Step.Result.PassFail = Evaluate(RunState.LoopIndex == 10) : False, Step.Result.PassFail ? "Passed" : "Failed" "
When this runs, the opening While step immediately fails, presumabely due to RunState.LoopIndex not equaling 10. This seems to override the Loop Condition statement.
Is this even possible or do I need to build some other logic to make this work?
10-01-2015 11:10 AM
Have you considered puting the steps you wnat to loop on in a sequence that returns a True/False boolean and then calling that sequence using a custom loop?
You can then set the Loop while expression to "RunState.LoopIndex < 10 && RunState..RunState.LoopNumPassed < 1"
I hope this helps.
-Jack