NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatic goto step

I am calling a custom dialog action step which returns a numeric value based on which I want to goto one of several subsequent steps. I don't want a load of teststand flow steps for this simple requirement.

 

I tried setting a post action custom condition = True and messing with CustomTrueActionTargetByExpr = "stepname" but this causes an error.

 

Any ideas how to do this successfully? I am using version 4.1.1

0 Kudos
Message 1 of 3
(3,149 Views)

You are close. I tried setting to CustomTrueActionTargetByExpr to "<Id of step>" and it worked. I think the documentation is incorrect in stating to use the name of the step. I'll file a bug report on that.

 

You could also directly set SequenceContext.NextStepIndex and SequenceContext.StepGroup.

Message 2 of 3
(3,147 Views)

You are close. I tried setting to CustomTrueActionTargetByExpr to "<Id of step>" and it worked. I think the documentation is incorrect in stating to use the name of the step. I'll file a bug report on that.

 

Actually it may be correct... I experimented a bit further and the following worked Ok after I put escaped double quotes round each step name:

 

Step.CustomTrueActionTargetByExpr = (Locals.ButtonPressed == 1 ? "\"fred\"" : ( Locals.ButtonPressed == 2 ? "\"barney\"" : "\"wilma\"" ) )

0 Kudos
Message 3 of 3
(3,107 Views)