07-08-2014 09:12 AM
Hello All,
Working on a sequence of numeric limit tests, and need to set the limits programatically, based on an imported configuration file. I use a simple action call to set the limits with a code module (TestStand Set Property Value function), but in order to make the code module reusable, I need to pass in the step name for the test step it applies to, each time I call it. The problem is that the step that each limit applies to is several steps later in the sequence. I know that I can get the name of the next step (RunState.NextStep.Name) but need to know if it is possible to get names of later steps as well. I'm guessing it may have something to do with the "NextStepIndex" function, but can't seem to get the context right. Please advise. Thanks in advance.
GSinMN
07-08-2014 09:56 AM - last edited on 10-20-2024 09:42 PM by Content Cleaner
Hey GSinMN,
This can be done with an expression like the following: RunState.Sequence.Main["MyStepName"].
Another thing you might be interested in is the Property Loader, which handles these types of operations for you by allowing you to create a file with limits and later load those limits into your test sequences. You can use the Property Loader as a step, or from the Tools menu in the Sequence Editor.
07-08-2014 09:59 AM
Figured it out myself.
Locals."Variable To Set" = RunState.Sequence.GetStep((RunState.Sequence.GetStepIndex(Step.Name, StepGroup_Main))+"Number of steps in Future",StepGroup_Main).Name
Where "variable to set" is the name of the variable you are assigning the step name to and "number of steps in future" is an integer that represents the index with respect to the current step (i.e. 2 would mean the second step after the current step).
GSinMN
07-08-2014 10:00 AM
Thanks for the reply Daniel. I was writing mine the same time you were.