Overriding the Default Recovery System

The default recovery system specifies what Silk Test Classic does to restore the base state of your application. It also specifies what Silk Test Classic does whenever:

You can write functions that override some of the default behavior of the recovery system.

To override Define the following
DefaultScriptEnter ScriptEnter
DefaultScriptExit ScriptExit
DefaultTestCaseEnter TestCaseEnter
DefaultTestCaseExit TestCaseExit
DefaultTestPlanEnter TestPlanEnter
DefaultTestPlanExit TestPlanExit

If ScriptEnter, ScriptExit, TestcaseEnter, TestcaseExit, TestPlanEnter, or TestPlanExit are defined, Silk Test Classic uses them instead of the corresponding default function. For example, you might want to specify that certain test files are copied from a server in preparation for running a script. You might specify such processing in a function called ScriptEnter in your test frame.

If you want to modify the default recovery system, instead of overriding some of its features, you can modify defaults.inc. We do not recommend modifying defaults.inc and cannot provide support for modifying defaults.inc or the results.

Example

If you are planning on overriding the recovery system, you need to write your own TestCaseExit(Boolean bException). In the following example, DefaultTestcaseExit() is called inside TestCaseExit() to perform standard recovery systems steps and the bException argument is passed into DefaultTestCaseExit().

if (bException)
  DefaultTestcaseExit(bException)

If you are not planning to call DefaultTestcaseExit() and plan to handle the error logging in your own way, then you can use the TestcaseExit() signature without any arguments.

Use the following function signature if you plan on calling DefaultTestCaseExit(Boolean bException) or if your logic depends on whether an exception occurred. Otherwise, you can simply use the function signature of TestcaseExit() without any arguments. For example, the following is from the description of the ExceptLog() function.

TestCaseExit (BOOLEAN bException)
if (bException) 
  ExceptLog() 

Here, DefaultTestcaseExit() is not called, but the value of bException is used to determine if an error occurred during the test case execution.