Tuesday, March 29, 2011

Recovery Scenarios

Recovery Scenario Manager:

To recover from unexpected events and errors that are occurred in the test environment during run session, we can use Recovery Scenario Manager. For good recovery, error must be known the occurrence is unknown.

There are (4) Types of events such as:

(i) Application Crash

An open application fails during Test Run.

Navigation:

Resources Menu -> Recovery Scenario Manager-> Click New-> Click Next ->
Select Application Crash as Trigger event->Next ->Select selected executable
application->Next ->Select Recovery Operation [Keyboard, Mouse Operation,
Close Application Process, function Call, Restart, Microsoft Windows] ->Next ->If
you want to check Add another operation else uncheck->Next ->Next ->Enter
Scenario Name ->Next->Select Option ->Finish ->Close ->Save the scenario in
specified location with “.qrs”
(qrs stands for QuickTest Recovery Scenario.)

(ii) Popup Window.

To handle unwanted popups.

Navigation:

Resources Menu ->Recovery Scenario Manager ->New ->Next ->Select “Popup
Window” as Trigger event ->Next ->Click on Hand Icon ->Show unwanted
window with Hand icon ->Next ->Next ->Select function call as Recovery
Operation ->Next [Open Notepad ->Save empty file with .vbs extension] ->Browse
the .vbs fie path ->Next ->Uncheck Add another Recovery Operation ->Next ->
Select Post-Recovery Test Run Option [Repeat current step and continue, Proceed to
Next step, Proceed to Next Action, Proceed to next test iteration, Restart current test
run, Stop the Test Run] ->Next ->Enter Scenario Name ->Next ->Select Option ->
Finish ->Save the scenario with “.qrs” ->Record required Recovery Operation [Click
ok, Click Cancel] take the script into function ->Save the library file ->Click Run

(iii) Test Run Error.

A step in your test does not run successfully then Test Run Error
can be raised.

Navigation :

Resources Menu ->Recovery Scenario Manager ->New ->Next ->Select “Testrunerror
Window” as Trigger event ->Next ->select any error o ->Next ->Next ->Select function call as Recovery
Operation ->Next [Open Notepad ->Save empty file with .vbs extension] ->Browse
the .vbs fie path ->Next ->Uncheck Add another Recovery Operation ->Next ->
Select Post-Recovery Test Run Option [Repeat current step and continue, Proceed to
Next step, Proceed to Next Action, Proceed to next test iteration, Restart current test
run, Stop the Test Run] ��Next ��Enter Scenario Name ��Next ��Select Option ��
Finish ��Save the scenario with “.qrs” ��Record required Recovery Operation [Click
ok, Click Cancel] take the script into function ��Save the library file ��Click Run

(iv) Object State.

The property values of an object in your application match
specified values. You can specify property values for each object in the
hierarchy.

Navigation:

Resources Menu -> Recovery Scenario Manager -> New -> Next -> Select “Object state
Window” as Trigger event -> Next -> Click on Hand Icon -> Show object with hand icon
-> Next -> Next->select object property with value (enabled ,false)->click next -> Select function call as Recovery
Operation -> Next [Open Notepad -> Save empty file with .vbs extension] -> Browse
the .vbs fie path -> Next -> Uncheck Add another Recovery Operation -> Next ->
Select Post-Recovery Test Run Option [Repeat current step and continue, Proceed to
Next step, Proceed to Next Action, Proceed to next test iteration, Restart current test
run, Stop the Test Run] -> Next-> Enter Scenario Name -> Next -> Select Option ->
Finish -> Save the scenario with “.qrs” -> Record required Recovery Operation [Click
ok, Click Cancel] take the script into function -> Save the library file -> Click Run



While creating Recovery Scenario for Pop-up window..In 'Recovery operation' we have to call a function. Can u tell me that function?


1. Go to TOOLS -> Recovery scenario manager.
2. Select the trigger event that caused the error(it may be a pop up window).
3. Identify the name of the window with the help of POINTING HAND.
4. Choose the operation type : KEYBOARD OR MOUSE OPERATION.
5. Select the action with the help of POINTING HAND.(e.g.Click on OK button to close the window.)
6. If you want to add another action then keep "Add another
recovery scenario" check box selected else de select it.
7. In the "Post recovery test run option" select "Proceed to next test iteration"
8. Give scenario name & description & click on finish button.
9. Save the scenario.
10. Go to TEST->SETTINGS->SCENARIO TAB....and add the saved scenario.
11. Click on APPLY & OK button......now your test run smoothly.



see... generally we can handle those pop up window exeptions
by writing If then statement and using exist method.

for example...

If window("skdhja").dialog("text:=fahda").exist then
window("skdhja").dialog("text:=fahda").winbutton("text:=OK(or)Cancel").click
window("akdhja").close
else
If you select “Function call" option we have to select the
file containing our library functions.
then we will have two radio buttons
1.Select function
2.Define new function
if we select the 'select function' radio button then we have to use the following syntax

Function (Object)
‘ recovery information and code goes here
End Function

Example:
‘ Close the About Notepad window.
Function AboutWindow(Object)
Object.Highlight
Object.Close
End Function


if we choose 'Define new function' then Create a new
function by specifying a unique name for it, and defining
the function in the Function Name box according to the
displayed function prototype. The new function is added to
the library file you selected.



No comments: