10-19-2008 01:28 PM
Hi,
The top level of my sequence is a list of subsequences, each one being a sub-test.
While inside one particular sub-test I would like to know the name of the sub-test which was executed before the one I'm in at the moment. Obviously this is relevant only when I run selected sub-tests.
example:
MyTest.seq
sub-test1
sub-test2
sub-test3
I'm inside sub-test3 (in the setup or main sequence), and would like to know the name of the sub-test which was executed before sub-test3. It is possible that no sub-test ran before sub-test3.
Thanks
RK
Solved! Go to Solution.
10-20-2008 12:53 AM
Hi Rafi,
Try RunState.PreviousStep.Name()
Do a check if PreviousStep exists by using PropertyObject("", 0) with RunState.PreviousStep as the reference.
Hope this helps
Regards
Ray
10-20-2008 11:39 AM
10-22-2008 04:29 AM
Thanks Ray,
Previous step does not work because I'm verifying it within a sub-sequence (see my example). Previous step, then, will give the name of the stop executed previously to the present step. THIS IS NOT WHAT I WANT. I'm looking to find out the name of the sub-sequence that ran before the sequence i'm in.
example
MainSequence
sub-seq-1
sub-seq-2
sub-seq-3
I'm inside sub-seq-3. I run a partial test and therfore I would like to know whether sub-seq-2 ran previously or not.
(I can work it out, using a local variable but I'm interested to learn how to find it using the RunState variables.)
Thanks
10-22-2008 05:07 AM
Hi Rod,
Thanks for the links and especially to the one with the example. Indeed some example!! I ran it and was overwhelmed by that one step that creates a whole array of steps name. Very nice. I will take me some time to digest it...but I got the idea.
Besides this, I'm still looking for a simple way to find just the name of the sub-seq that ran before the present sub-seq (please see my answere to Ray).
Thanks
Rafi
10-22-2008 06:32 AM
Hi Rafi,
Sorry about that. What you might try is RunState.Caller.RunState.PreviousStep.
RunState.Caller gets you back to the Caller Sequence and therefore you should be able to get the Previous step. I haven't tried it as I dont have TestStand to hand but it should work.
Regards
Ray
10-22-2008 10:39 AM
10-23-2008 01:52 AM
Thanks Ray and Rod,
It is working now! However, I ended up using the index rather than the name (RunState.Caller.RunState.StepIndex and ... PreveiousStepIndex. By using the indexes I can tell whether the previous test has been executed and whether the running test is the first step.
Thanks again
Rafi