03-21-2011 12:00 PM
Hi!
I want to end testing if any failure occures. So I have inserted into the SequenceFilePostStepFailure callback (in the client file) a statement which goes like this: "RunState.Caller.RunState.GotoCleanup=true"; However, I dont want this behavior if a failure occures outside the main sequence, because I have overridden PostUUT callback with some code and here I don't want to go to the cleanup step group. Code outside the main sequence should always be executed completely also if failures occur.
A simple way would be to set a fileGlobal which is true only inside the main sequence. But I prefer to avoid this FileGlobal and use inside the SequenceFilePostStepFailure callback the RunState to determine if the caller is a descendent of the main sequence. Unfortunately inside the parameters of the callback only the step information is visible but not the call stack.
w.
03-21-2011 04:25 PM
Try using the expression:
'RunState.Caller.Sequence.Name': in the SequenceFilePostStepFailure callback.
Thanks,
PH
03-21-2011 04:41 PM - edited 03-21-2011 04:41 PM
Thanks for replying, Teds.
However, your proposal does not fullfill my intention because I do not want to use a list of sequence names to determine, if
I am in the MainSequence or not. No problem, in the meanwhile I found a perfect solution. I insert a precondition on the
'...GotoCleanup = true' statement: NameOf(RunState.Main.RunState.Sequence) == "MainSequence"
RunState.Main contains the runstate of the least nested sequence which is not in the process model. So, within the MainSequence
(or nested sequence calls) it contains the RunState of the MainSequence. Within PostUUT (or nested ... ) it contains the runstate of PostUUT.
And so on.
So I have now a solution which is compact and does not rely on additional variables to be created.
bye
w.