Friday, December 09, 2011

Recovery Scenarios -QTP


Recovery Scenarios
What is a recovery scenario:
Recovery scenario - a definition of an unexpected event or error or application crash and the operation(s) necessary to recover the run session
A recovery scenario consists of the following
Trigger Event—The event that interrupts your run session.
Recovery Operation(s)—The operation(s) that need to be performed in order to continue running the test or component
Post-Recovery Test Run Option—The instructions on how Quick Test should proceed once the recovery operations have been performed, and from which point in the test or component Quick Test should continue, if at all.
Recommendations for using Recovery Scenarios
If you can predict that a certain event may happen at a specific point in your component, it is highly recommended to handle that event directly within your component by adding steps such as If statements or “Optional Steps” in user-defined functions, rather than depending on a recovery scenario.
You should use recovery scenarios only for unpredictable events, or events that you cannot synchronize with a specific step in your component.
Handling an event directly within your component enables you to handle errors more specifically than recovery scenarios. It also enables you to control the timing of the corrective operation with minimal resource usage and maximum performance.
Different Recovery Operations:
Keyboard or mouse operation—QuickTest simulates a click on a button in a window or a press of a keyboard key.
Close application process—QuickTest closes specified processes.
Restart Microsoft Windows—QuickTest restarts Microsoft Windows.
Function call—QuickTest calls a VBScript function.
Different Post-Recovery Test Run Options:
Repeat current step and continue
The current step is the step that QuickTest was running when the recovery scenario was triggered.
Proceed to next step
Skips the step that Quick Test was running when the recovery scenario was triggered.
Restart current test run
Stops performing steps and re-runs the component from the beginning.
Stop the test run
Stops running the component.
Associating Recovery Scenarios with the test:
While associating the recovery with your test, you need to specify when you want to activate recovery scenarios i.e. only on errors or on every steps.
If you select On errors option then keep in mind that by default, recovery operations will be activated only when a step returns an error, which can potentially occur several steps after the one that actually caused the error. So you may get the advantages of using recovery scenarios
If you select on every steps then keep in mind that checking for trigger events after every step, may slow performance.

No comments:

Post a Comment