defaults.inc

The defaults.inc file is provided by Silk Test Classic and implements the recovery system for a single application test. That is, it contains the DefaultBaseState function that performs any cleanup needed after an operation under test fails and returns the application to its base state.

You can define a base state function to replace the DefaultBaseState function by defining an application state without using the basedon keyword. This creates an application state that 4Test executes instead of the DefaultBaseState function.

The defaults.inc file contains six other functions that 4Test automatically executes unless you define functions that replace them:
DefaultScriptEnter
A null function, allows you to define a ScriptEnter function, as discussed below.
DefaultScriptExit (BOOLEAN bException)
Logs an exception to the results file when a script exits because of an exception.
DefaultTestcaseEnter
Executes the SetAppState function. If you have specified an application state for this test case, the SetAppState function brings your test application to that state. If you have no application state defined, SetAppState brings the application to the base state (if necessary).
DefaultTestcaseExit (BOOLEAN bException)
Logs an exception to the results file when a test case exits because of an exception. The function then executes the SetBaseState function, which calls a base state function that you have defined or the DefaultBaseState function.
DefaultTestPlanEnter
A null function, allows you to define TestPlanEnter, as discussed below, to allow logging of results.
DefaultTestPlanExit (BOOLEAN bException)
A null function, allows you to define TestPlanExit, as discussed below, to allow logging of results.

The word "Default" in each of the above function names signifies that you can define alternative functions to replace these. If, for example, you define a function called TestcaseEnter, 4Test will invoke your function before executing any of the code in your test case and will not invoke DefaultTestcaseEnter.

TestPlanEnter() is not called until the first test case in the plan is run. Or the first marked test case, if you are only running marked test cases. Similarly, TestPlanExit() is called at the completion of the last marked test case. TestPlanExit() is only called if the last marked test description contains an executable test case, which means not a manual test case or a commented out test case specifier.