Jump to another step in OpenTAP based on a condition?

Hi,

Is it possible in OpenTAP to jump to a specific step (by name or position) if a condition is not met or a step fails?

For example: if a validation step fails, I’d like execution to continue at a “Recovery” step instead of the next step or abord. I’ve seen If/While flow steps, but they don’t seem to allow jumping to an arbitrary step.

Is there a built‑in way to do this, or what’s the recommended approach?

Thanks!

1 Like

I have a similar issue.

Let’s say a digital input signal from a PLC isn’t arriving, and I’m now in the middle of my test plan (workflow). As an administrator, I’d like the option to skip this test step (WaitForDigitalInput) as a way to determine whether it’s good or bad.

From the a test step, it is possible to set StepRun.SuggestedNextStep. If the other steps supports it, this enables jumping to an arbitrary other step in the test plan.

This can also be done via a mixin with the ITestStepPostRunMixin interface, so you can attach the behavior dynamically.

Note, that not all test steps supports this, for example custom loops steps wouldn’t support it unless support is explicitly added.

2 Likes

Thank you @rolf_madsen!