Forum Discussion

kimmatsumoto's avatar
kimmatsumoto
Contributor
6 years ago
Solved

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

2 Replies