07-19-2011 12:12 PM
Hi,
I have a main sequence file (with a number of test cases) calling another 2nd sequence file. I like to abort from my 2nd sequence file if a paremeter returned is certain value (e.g. parameter.result == "1") from TestComplete. What command can I use?
Also once the 2nd sequence file aborts, I need the main sequence file to continue on the next step.
Thanks!
07-19-2011 05:29 PM
By 'abort' I assume you mean terminate. That call is RunState.Execution.Terminate()
Not sure this is the direction you want to go as there are other options for exiting such as failing a test and setting the runstate flag to gotocleanonfailure or something along those lines.
07-20-2011 02:45 AM - edited 07-20-2011 02:48 AM
I think you should use post expressions/action: go to step: cleanup
07-20-2011 02:39 PM
Thanks Snowpunter!
I'll look into it.
07-20-2011 02:40 PM
Thanks Roderic! I'll look at both solutions.
07-20-2011 03:27 PM
Using the Terminate() call is perhaps the better solution, as setting the GotoCleanup property doesn't change the Result.Status for the calling step.
07-21-2011 09:01 AM
Hi All,
How do I implement the Runstate.Execution.Terminate() ? I tried using a f(x) statement step, then Edit Expression, and all I see is Runstate.Execution.
Thank you
Peter
07-21-2011 09:09 AM
The easiest way is to use the Post Action in the Step to Terminate.
But I dont think you want to do that because you still want the caller sequence to run. Therefore use the Post Action of the Step to goto to CleanUp. This will then skip the remaining steps in the Main, run any steps you have in the Cleanup and return back to the Caller Sequence which continue running onto the next step.
07-21-2011 09:43 AM
If you do want to use terminate, but want the parent sequence to still continue running, you can use the run option "Ignore termination" on the sequence call step.
07-21-2011 10:38 AM
Thank you Ray_Farmer and dug9000. I'll try both solutions when I get to the lab.
I just realized I have a three layered sequence calls. So I need to terminate the steps at the child 3rd sequence file, and return to the parent sequence file and continue on the next step. I suppose I don't need to do anything in the 2nd sequence file, right?
Also, what should I put in the cleanup tab so that it will return to the parent sequence call and contine on the next step?
Thanks!
Peter