11-03-2009 03:42 AM
Hi,
I have a sequence file containing MainSequence, Measurement and OnFail SubSequences.
The MainSequence prepares the power supplies and instruments.
The Measurement-SubSequence performs the measurement. The teststep in it has an PostAction: On Fail call SubSequence 'OnFail'.
The OnFail SubSequence asks the operator weather he would like to repeat the Measurement or to abort the execution of the test.
If the operator clicks 'repeat' there is a CallSequence teststep, that calls the Measurement-SubSequence.
If the operator cicks 'abort' i would like to go to the CleanUp of the MainSequence. But i have no idea how?!?
The CallSequence Teststep only selects an Sequence, but no teststep in a sequence. Sure, i could set a Flag-Variable and use this flag to jump in the MainSequence to the CleanUp, but i think this ist a bad work-around.
Is there an Easy Way to do a safe abort/termination of the execution with a big fail in the testreport?
11-03-2009 08:06 AM
You can terminate the execution.
Cleanup step groups execute as part of the termination process. If the execution is an interactive execution, use the Execution.TerminateInteractiveExecution method instead.
The execution might not terminate immediately. If a call to a step module is active, the execution waits for the step module to return.
This is the help for Execution.Terminate. Please note that the CleanUp stepgroups are executed for the whole callstack except the process model which proceeds "properly" (which for instance creates the report).
hope this helps,
Norbert
11-03-2009 08:14 AM
11-03-2009 08:17 AM
Where have you set the termination?
It is best if you could post your sequence file in order to show us your approach.
Norbert
11-03-2009 08:26 AM
i attached the file.
11-03-2009 08:33 AM
You are never terminating the execution. Your statemante "Terminate Execution" in the "On Fail" sequence always results in "Done" and therefore will never 'trigger' the post action On Fail.
Your statement has to include something like the following as Expression:
RunState.Execution.Terminate()
hope this helps,
Norbert
11-03-2009 08:37 AM - edited 11-03-2009 08:39 AM
but the measurement fails a few steps earlier... because of this the hole sequence must fail?!?
or not?
11-03-2009 08:41 AM
The On Fail post action is only executed for the step which fails. Since the statement never fails, the On Fail is never executed.....
Please don't mess up between the sequence status and the step status!
Norbert
11-03-2009 08:48 AM
OK, i'll try RunState.Execution.Terminate() tomorrow.
Thanks a lot!
11-04-2009 02:52 AM
Hi,
i tried the RunState.Execution.Terminate() Method in an Expression-Step in Case of a Failing Step. But the inidcator at the end of the test says 'Pass'. There is a conflict between the failing step and the result. See the screenshot.
What can i do?