11-28-2024 09:21 AM
11-29-2024 03:40 PM
Configuring a step to loop sets an expression that determines whether the overall status of the step should pass or fail. That condition is stored on the loop step's properties under Step.TS.LoopStatus. For a simple loop of 10 times and the step fails on every call, the step failure callback is called 10 times, and then it is called again when the step evaluates the loop status and it evaluates to False (Failed), so a total of 11.
In my test that fails every step call, the value of RunState.Caller.RunState.SequenceFailed is False for the first 10 calls to the callback and is True for the 11th call where the step is evaluating the loop status. You should be able to just look at that property.
Note that for subsequent steps that fail in the sequence with the looping step, that property will still be True, so you have to only process when on the first call to the callback per call stack.