Recovery Scenario *** 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 (). Version 1.0 is released and came for testing 1. 2. 3. 4.
Open the version 1.0 application put tool in recording mode select all the cities names, so that *script will be generated. Stop recoding
V1.0 Chennai Hyderabad Delhi
After some time Version 2.0 is released with some changes V2.0 1. Open the version 2.0 application Chennai 2. Use the *same generated script only Delhi 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 comes when the application is missed.
-: The End :Pls. leave your feed back (both +ve and –ve ) at
[email protected]