Sunday, November 29, 2009

23. Recovery Scenario Manager:

Identifying Exceptions:
Unexpected events during a test run disrupt a test or may give invalid test result. For example, during a test run, an application error may occur. This error does not permit the automated test to navigate to the feature, Screen, or Module that needs to be tested. These unexpected errors and events are called exception.
An exception could occur in the AUT or an exception could occur because sources are external to the AUT. For Example, an exception occurs if notification messages, such as you have mail or Printer out of Paper, appear during a test run.
Events that are expected to occur during a test run are not called exceptions. For Example, the message box that appears when you enter a bad password is an expected event. Similarly, the prompt to save changes or enter details in a mandatory field are expected events. You cannot classify these events as exceptions.
Introduction to a Recovery Scenario:
To successfully complete a test run, you need to identify the exceptions that can occur during a test run and take appropriate action to handle the exceptions.
You can create recovery scenarios in Quick Test Professional to handle exceptions that occur during a test run. A recovery scenario consists of the following components:
• Trigger: Specifies the exception that may occur during a run session. For Example, the test may be interrupted by an error pop-up window.
• Recovery: Instructs Quick Test how to handle the exception. For Example, you can instruct Quick Test to click a button on the error pop-up window to close the window.
Post-Recovery: Instructs Quick Test how to proceed after the recovery operations are performed. For Example, after an exception is handled; you may want Quick Test to restart a test from the beginning.
After you create a recovery scenario, you can associate it with one or more tests.

To create Recovery Scenario:
Step 1:
Enter invalid input in the application, and execute the Script. Now it shows the pop-up message.
Step 2: From the Quick Test Professional menu bar, select Resources>Recovery Scenario Manager. The Recovery Scenario Manager Dialog box appears.
Step 3: In the Scenario Section, click the New Scenario button to display Recovery Scenario Wizard.
Step 4: Click Next. The Select Trigger Event appears.

Note: In the first component of a Recovery Scenario, you identify the event type that can disrupt a test run.
To select a trigger Event type:
• Popup Window: if a popup window appears in an open application.
• Object State: If a mismatch occurs between the expected and the actual state of an object in the test.
• Test Run Error: If a step in the test fails.
• Application Crash: If an open application fails.

Step 5: Select Popup Trigger Event, click Next.

Note: After you select a trigger event type, you specify the conditions that can help Quick Test identify the correct event during a test run.

Step 7: On the Specify Pop-up Window Conditions page, click the Pointing hand button, and click the Pop-up error message box that you want the recovery scenario to handle.
Step 8: The Window Title and the Window Text Contains fields display the conditions to identify the Pop-up window.
Step 9: Click Next. The Recovery Operation Page appears.
Step 10: No need to enter anything now, click Next.

Note: After you specify the trigger event type and the trigger event conditions in Recovery Scenario Wizard, you specify the recovery operation(s) required to handle the trigger event. To identify the recovery operation.
Step 11: Select Keyboard or Mouse Operation, it performs a key press or a mouse click recovery operation.
Step 12: Select Next to select a recovery operation, such as Click Button with Label.
Step 13: Click on Hand Button to capture the buttons in the Pop-up error message.
Step 14: Now it captures the Ok button, click on Next.
Step 15: Click Next to Capture another button.
Step 16: Next>Keyboard or Mouse Operation>Next>Click Buttons with Label>Click on Hand button.
Step 17: Press Control Button to Deactivate the Capture and click on OK in the error pop-up message.
Step 18: Now Remove the Control Button and Capture the Cancel Button in the application to close the Application.
Step 19: Click on Next.
Step 20: Remove the Add another Recovery Operation Checkbox to Stop adding Recovery Operation.
Step 21: Click on Next.

Note: After you specify the recovery operation, identify the operation that you want to perform when the recovery operation complete.
Step 22: Select Proceed to next test iteration Radio button in Post Recovery Test Run Options to apply no of iterations to the recovery, Click on Next.

Note: After you identify a trigger event and select the recovery and Post-Recovery operations for a recovery scenario, you use the Name and Description page to provide a name and Description for the recovery scenario.
Step 23: In Scenario Name field enter the name for the Scenario you created and enter the Description in the Description field (Optional).
Step 24: Click on Next.
Step 25: The Completing The Recovery Scenario Wizard page displays the details of the recovery scenario in the Scenario Settings Section.
Step 26: To associate the recovery Scenario with the current test, check the Add Scenario to Current Test Check box.
Step 27: To save the recovery Scenario, Click Finish. The Recovery Scenario Manager Dialog box appears.

Note: After you create a recovery scenario, save the recovery scenario to a file.

Step 28: In Recovery Scenario Manager, click Save button to save the Scenario, and click Close to close the Recovery Scenario Manager.
Step 29: To add an existing recovery scenario to a test. From the Quick Test Professional Menu bar select File>Settings.
Step 30: In the Settings dialog box, click the Recovery tab.
Step 31: Defaultly the Saved Recovery will be available, if it not Available, click the Add button.
Step 32: Browse the Saved Recovery to the particular test. Click OK to apply the Scenario to the test.
Step 33: Execute the Script to Analyze the Result.

No comments:

Post a Comment