cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for a procedure which will stop the execution of a wrapper procedure

SOLVED
Contributor

Looking for a procedure which will stop the execution of a wrapper procedure

Hi,

 

I included the Runner.Halt procedure in my wrapper when I want it to exit because a script failed which will cause the remaining scripts in the wrapper to fail.  Unfortunately, the Runner.Halt procedure not only stopped the execution of the wrapper procedure but also the remaining items in the project suite.

 

I need a way to stop the execution the the wrapper procedure and continue to execute the items in the project suite.

 

Example of wrapper procedure;

procedure TC_4147;
var
ErrCnt : integer;
begin
//--SRW--
ErrCnt := Log.ErrCount;
if Log.ErrCount = ErrCnt then
try
try
if GetLatestSRW=nil then
Login_SRW('892354', 'ns90502', 'W4JJ', 'SI892354', 'ns90502');
TC_4147_SRW;
Log.Message('SRW executed.');
except
Log.Error('An Unexpected Scripting Error Occurred: ' + ExceptionMessage);
TerminateSRW;
Log.Warning('**Profile/s created for this test case must be deleted/purged manually.**');
Runner.Halt('Exit the wrapper procedure because the inital profile create step failed.');
end;
finally
TestExecuteLogFiles.CommitLog;
end;
//--SPS Test Tool
if Log.ErrCount = ErrCnt then
try
try
if GetLatestSPSTestTool=nil then
LaunchSPSTestTool;
TC_4147_SPS;
Log.Message('SPS Test Tool executed.');
except
Log.Error('An Unexpected Scripting Error Occurred: ' + ExceptionMessage);
TerminateSPSTestTool;
Runner.Halt('Exit the wrapper procedure because sync failed.');
end;
finally
TestExecuteLogFiles.CommitLog;
end;
//--CBO--
if Log.ErrCount = ErrCnt then
try
try
Login_CBB_2.LoginforSPS('SYSDBA', 'cbo1111', EnvironmentSettings2.DataPumpPCC);//SP4I
TC_4147_CBO;
Log.Message('CBO executed.');
except
Log.Error('An Unexpected Scripting Error Occurred: ' + ExceptionMessage);
TearDownBrowser;
end;
finally
TestExecuteLogFiles.CommitLog;
end;
//--SRW Purge Profile--
try
try
if GetLatestSRW=nil then
Login_SRW('892354', 'ns90502', 'W4JJ', 'SI892354', 'ns90502');
log.Message('Executing purge of Cellar Door');
PurgeProfile('Corporate', 'Cellar Door');
ClearSearch;
MinimizeSRW;
Log.Message('SRW executed.');
except
Log.Error('An Unexpected Scripting Error Occurred: ' + ExceptionMessage);
TerminateSRW;
Log.Error('**Delete/Purge failed--Profile/s created for this test case must be deleted/purged manually.**');
end;
finally
TestExecuteLogFiles.CommitLog;
end;
end;

 

Kind regards,

Kim

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Looking for a procedure which will stop the execution of a wrapper procedure

I believe what you're looking for is Runner.Stop()

 

https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/script/runner/stop.h...

 

It has one parameter which if set to true only stops the current test item, not the entire project. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
2 REPLIES 2
Community Hero

Re: Looking for a procedure which will stop the execution of a wrapper procedure

I believe what you're looking for is Runner.Stop()

 

https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/script/runner/stop.h...

 

It has one parameter which if set to true only stops the current test item, not the entire project. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Contributor

Re: Looking for a procedure which will stop the execution of a wrapper procedure

Thank you Carson...the solution you provided is working.

 

Kim

New Here?
Join us and watch the welcome video:
Top Kudoed Authors