The built-in recovery system is one of the most powerful features of Silk Test Classic because it allows you to run tests unattended. When your application fails, the recovery system restores the application to a stable state, known as the BaseState, so that the rest of your tests can continue to run unattended.
The recovery system can restore your application to its BaseState at any point during test case execution:
Silk Test Classic uses the recovery system for all test cases that are based on DefaultBaseState or based on a chain of application states that ultimately are based on DefaultBaseState.
Such a test case will be defined in the script file as:
testcase Name () appstate none
Silk Test Classic records test cases based on DefaultBaseState as:
testcase Name ()
The default recovery system is implemented through several functions.
Function | Purpose |
---|---|
DefaultBaseState | Restores the default BaseState, then call the application’s BaseState function, if defined. |
DefaultScriptEnter |
Executed when a script file is first accessed. Default action: none. |
DefaultScriptExit |
Executed when a script file is exited. Default action: Call the ExceptLog function if the script had errors. |
DefaultTestCaseEnter |
Executed when a test case is about to start. Default action: Set the application state. |
DefaultTestCaseExit |
Executed when a test case has ended. Default action: Call the ExceptLog function if the script had errors, then set the BaseState. |
DefaultTestPlanEnter |
Executed when a test plan is entered. Default action: none. |
DefaultTestPlanExit |
Executed when a test plan is exited. Default action: none. |
You can write functions that override some of the default behavior of the recovery system.