4.recovery scenarios

7
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 -------

Upload: anand

Post on 15-Nov-2014

103 views

Category:

Documents


0 download

DESCRIPTION

Various Types of Recovery Scenarios available in QTP

TRANSCRIPT

Page 1: 4.Recovery Scenarios

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

Page 2: 4.Recovery Scenarios

* 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)

=================================================================

Page 3: 4.Recovery Scenarios

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

Page 4: 4.Recovery Scenarios

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 falseii. 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)

=================================================================

Page 5: 4.Recovery Scenarios

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 V1.0

1. Open the version 1.0 application2. put tool in recording mode3. 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.01. Open the version 2.0 application2. 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 onwardsWe just call an empty function which is stored in a library file3. Keep the cursor where the city name seems to be missed4. Activate tool menu item Tools5. Open recovery scenario manager wizard6. select trigger event as Test Run error7. choose the error type from drop-down box as Item in list or menu not fund8. Click NEXT9. Click NEXT to specify the recovery operation10. select operation type as Function call11. Click NEXT12. choose library file path where an empty function was stored13. Click NEXT14. De-select check box ( of add an other recovery scenario )15. Click NEXT16. Select post-recovery as Proceed to Next Step17. Give name and description for this scenario18. Click NEXT19. Select add scenario to current test20. click on Finish21. 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

ChennaiHyderabadDelhi

ChennaiDelhi

Page 6: 4.Recovery Scenarios

This error may comes when the application is missed.

-: The End :-

Pls. leave your feed back (both +ve and –ve ) at [email protected]