Recovery scenario in QTP

Recovery Scenario in QTP:

*** When you want to recover from any problem, First, face the problem manually, Find the solution manually , Recover from that problem manually.
And in the same way you implement for Automation ( in QTP)
Recovery Scenario with Pop-Up window
( When a pop-window appears either thru +ve testing or –Ve testing of the application )
I. Pop-Up window ( Manual )
ð Put tool in Recording mode
ð open the AUT ( say flight Application )
ð Enter User name ( kanakadri )
ð *Click on OK ( wontedly for getting an error) : see the relevant script and copy that line only.
ð You will get a “pop-up” window saying with some message
ð Enter OK on that pop-up window
ð Enter password ( mercury)
ð Click OK
ð Stop Recoding
——————————————————
Open a new test , Type Function () , you will get
Function
End Function
Modify the above code as below
Function popup_recovery()
* Copy that line here
End Function
—— Copy it and open a new NotePad and past it .
Save it with .vbs (VBSctipt ) Extention as library file ——-
II. Pop-Up window ( thru QTP )
ð Put tool under recording mode
ð open the AUT ( say same flight Application )
ð Enter User name ( kanakadri )
ð Click on OK
ð *A pop-up will appear , click on OK ( see this script code, which should be removed later)
ð Enter password
ð Click on OK
ð Stop recording
* Remove that code and keep cursor here it self.
Now Actual Recovery scenario for pop-up window starts …..
ð open the AUT ( say same flight Application )
ð Enter User name ( kanakadri )
ð Click on OK
ð *the same pop-up will appear , DON’T’ click on it.
ð Open tools -> Recovery Scenario Manager
ð Select the new scenario ( wizard will appear)
ð Click NEXT
ð Select trigger event option as pop-up window
ð Click NEXT
ð With help of HAND Button select * that pop-up’s object (OK) of AUT
ð Click NEXT
ð Click NEXT to specify the recovery operation
ð Select Function Call option
ð Browse the library file which u have saved as with .vbs extention in the beginning.
ð Click NEXT
ð De-select the check box ( of add an other recovery operation )
ð Click NEXT
ð Choose Post-Recovery operation as Repeat Current Step and Continue.
ð Click NEXT
ð Give the name and description
ð Click NEXT
ð Check the check-box of Add Scenario to Current test
ð Click FINISH
ð Save it as with .qrs ( Quick Recovery Scenario) extension
ð Click CLOSE
Run the Test which will Pass the results of course with Warnings ( may ignore it)
=================================================================
Recovery Scenario with Object State
( When the object is disabled )
I. Object State ( Manual )
ð Put tool in Recording mode
ð open the AUT ( say flight Application )
ð Click on Open order icon
ð A open order Dialog box will appear
ð In which check the Order number check box
ð See OK button is Disabled now
ð Enter order number (say 9)
ð *See the relevant script and copy that line only ie. where u entered 9
ð Now OK button will be enabled
ð Click on OK
ð An order with that number (say 9) will be opened
ð Stop recording
——————————————————
Open a new test , Type Function () , you will get
Function
End Function
Modify the above code as below
Function popup_recovery()
* Copy that line here
End Function
—— Copy it and open a new NotePad and past it .
Save it with .vbs (VBSctipt ) Extention as library file ——-
II. Object State ( thru QTP )
ð Put tool in Recording mode
ð open the AUT ( say flight Application )
ð Click on Open order icon
ð A open order *Dialog box will appear
ð In which check the Order number check box
ð DON’T enter order number
ð Stop recording
Now Actual Recovery scenario for Object state starts …..
ð Open tools -> Recovery Scenario Manager
ð Select the new scenario ( wizard will appear)
ð Click NEXT
ð Select trigger event option as Object state
ð Click NEXT
ð With help of HAND Button select * that disabled object (OK) in the *Dialog box of AUT
ð Click NEXT
ð Set object properties and values
ð Click on Add/Remove button
ð Edit properties window will appear
i. Check property name as Enabled and value as false
ii. Check property name as Text and value as OK
iii. Check property name as window Id and value as 1
ð Click on OK
ð Click NEXT to specify the recovery operation
ð Select Function Call option
ð Browse the library file which u have saved as with .vbs extention in the beginning.
ð Click NEXT
ð De-select the check box ( of add an other recovery operation )
ð Click NEXT
ð Choose Post-Recovery operation as Repeat Current Step and Continue.
ð Click NEXT
ð Give the name and description
ð Click NEXT
ð Check the check-box of Add Scenario to Current test
ð Click FINISH
ð Save it as with .qrs ( Quick Recovery Scenario) extension
ð Click CLOSE
Run the Test which will Pass the results of course with Warnings ( may ignore it)
=================================================================
Recovery Scenario with Test Run Error
During execution one step may not execute properly , QTP will ignore it run next step on words .
For that we just need to call an empty function ().
Chennai
Hyderabad
Delhi
Version 1.0 is released and came for testing V1.0
1. Open the version 1.0 application
2. put tool in recording mode
3. select all the cities names, so that *script will be generated.
4. Stop recoding
After some time Version 2.0 is released with some changes V2.0
1.
Chennai
Delhi
Open the version 2.0 application
2. Use the *same generated script only
But when u run this program,
It execute fist city name (Chennai)
When it comes to second city name (Hyderabad)
Test will Stops and FAIL.
Though its missed , in order to continue the execution from next step onwards
We just call an empty function which is stored in a library file
3. Keep the cursor where the city name seems to be missed
4. Activate tool menu item Tools
5. Open recovery scenario manager wizard
6. select trigger event as Test Run error
7. choose the error type from drop-down box as Item in list or menu not fund
8. Click NEXT
9. Click NEXT to specify the recovery operation
10. select operation type as Function call
11. Click NEXT
12. choose library file path where an empty function was stored
13. Click NEXT
14. De-select check box ( of add an other recovery scenario )
15. Click NEXT
16. Select post-recovery as Proceed to Next Step
17. Give name and description for this scenario
18. Click NEXT
19. Select add scenario to current test
20. click on Finish
21. Save it with .qrs extension
Run the Test
When you Run it, it execute normally till it finds an error, when it found an error, It stops a while (means calling an empty function ) and continue.
The test will pass with warning (which u can ignore )
Recovery Scenario with Application error
This error may come when the application is missed.

Comments