Hello Friends,
In this post, we will look into the Recovery Scenario provided in QTP.
What is Recovery Scenario?
Recovery Scenarios are used to recover the test from unexpected errors and continue with execution.
What is unexpected errors?
Unexpected error or exception is a unpredictable/unexpected error which occurs suddenly during execution of the script. These kind of errors makes your script fail/stop/paused.
Anatomy of Recovery Scenarios?
A recovery scenario in QTP is a 3-steps process:
1. Trigger Event (Pop-up window, Object State, Test run error, App crash)
2. Recovery Operations
3. Post-Recovery Test Run Option
Trigger Event:
The event that interrupts your run session. Recovery scenario manger can handle following four events:
1. Pop-up window: To handle unwanted pop ups.
2. Object state: To handle object related errors at runtime.
3. Test run error: To handle vb script statement errors at runtime.
4. Application crash: To handle crashed applications at runtime.
Recovery Operations:
The operations to perform to enable QTP to continue running the test after the trigger event interrupts the run session. For example, clicking an OK button in a pop-up window.
Post-Recovery Test Run Option:
Post recovery, as the name suggests, is to instruct QTP on how to proceed after the recovery operations have been performed, and from which point in the test QTP should continue. You may want to restart a test from the beginning, or skip current step and continue with the next step in the test. Once you configure above in the recovery scenario manager, recovery scenarios are saved in the form of .qrs file. A recovery scenario file is a logical collection of recovery scenarios, grouped according to our specific requirements.
1. Recovery Scenario for Pop-up Window:
Steps to follow to handle unwanted pop-ups:
Trigger Event steps:
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 -->(Continue below mentioned steps)
Recovery Operations steps:
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 -->(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
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
2. Recovery Scenario for Object State:
Steps to follow to check Property values of an object in the application match specified values. User can specify property values for each object in the hierarchy.
Trigger Event steps:
Resources Menu --> Recovery Scenario Manager --> New --> Next --> Select “Object state Window” as Trigger event --> Next --> Click on Hand Icon --> Show object with and icon --> Next --> Next-->select object property with value (enabled ,false)-->click next --> (Continue below mentioned steps)
Recovery Operations steps:
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 -->(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
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
3. Recovery Scenario for Test Run Error:
Steps to follow to check if test does not run successfully then Test Run Error can be raised.
Trigger Event steps:
Resources Menu -->Recovery Scenario Manager -->New -->Next -->Select “Testrunerror Window” as Trigger event -->Next -->select any error o -->Next -->Next -->(Continue below mentioned steps)
Recovery Operations steps:
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 -->(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
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
What is Recovery Scenario?
Recovery Scenarios are used to recover the test from unexpected errors and continue with execution.
What is unexpected errors?
Unexpected error or exception is a unpredictable/unexpected error which occurs suddenly during execution of the script. These kind of errors makes your script fail/stop/paused.
Anatomy of Recovery Scenarios?
A recovery scenario in QTP is a 3-steps process:
1. Trigger Event (Pop-up window, Object State, Test run error, App crash)
2. Recovery Operations
3. Post-Recovery Test Run Option
Trigger Event:
The event that interrupts your run session. Recovery scenario manger can handle following four events:
1. Pop-up window: To handle unwanted pop ups.
2. Object state: To handle object related errors at runtime.
3. Test run error: To handle vb script statement errors at runtime.
4. Application crash: To handle crashed applications at runtime.
Recovery Operations:
The operations to perform to enable QTP to continue running the test after the trigger event interrupts the run session. For example, clicking an OK button in a pop-up window.
Post-Recovery Test Run Option:
Post recovery, as the name suggests, is to instruct QTP on how to proceed after the recovery operations have been performed, and from which point in the test QTP should continue. You may want to restart a test from the beginning, or skip current step and continue with the next step in the test. Once you configure above in the recovery scenario manager, recovery scenarios are saved in the form of .qrs file. A recovery scenario file is a logical collection of recovery scenarios, grouped according to our specific requirements.
1. Recovery Scenario for Pop-up Window:
Steps to follow to handle unwanted pop-ups:
Trigger Event steps:
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 -->(Continue below mentioned steps)
Recovery Operations steps:
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 -->(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
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
2. Recovery Scenario for Object State:
Steps to follow to check Property values of an object in the application match specified values. User can specify property values for each object in the hierarchy.
Trigger Event steps:
Resources Menu --> Recovery Scenario Manager --> New --> Next --> Select “Object state Window” as Trigger event --> Next --> Click on Hand Icon --> Show object with and icon --> Next --> Next-->select object property with value (enabled ,false)-->click next --> (Continue below mentioned steps)
Recovery Operations steps:
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 -->(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
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
3. Recovery Scenario for Test Run Error:
Steps to follow to check if test does not run successfully then Test Run Error can be raised.
Trigger Event steps:
Resources Menu -->Recovery Scenario Manager -->New -->Next -->Select “Testrunerror Window” as Trigger event -->Next -->select any error o -->Next -->Next -->(Continue below mentioned steps)
Recovery Operations steps:
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 -->(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
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
4. Recovery Scenario for Application Crash:
Steps to follow to check application failure during Test Run.
Trigger Event steps:
Resources Menu --> Recovery Scenario Manager--> Click New--> Click Next -->Select Application Crash as Trigger event-->Next -->Select selected executable application-->Next --> (Continue below mentioned steps)
Recovery Operations and Post-Recovery Test Run Option Steps:
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 with “.qrs”
Error handling (on error resume next) vs Recovery Scenarios ?
If you can predict that a certain event may happen at a specific point in your test or component, it is recommended to handle that event directly within your test or component by adding steps such as If statements or optional steps or "on error resume next", rather than depending on a recovery scenario. Using Recovery Scenarios may result in unusually slow performance of your tests.They are designed to handle a more generic set of unpredictable events which CANNOT be handled pragmatically.
Example:
On error Statements
Following are error statements :
1. On Error Resume Next
2. On Error Go to 0
3. err.number
4. err.description
On Error Resume Next:
On Error Resume Next statement enables the Error handling in the code.If there is error in the code "On error Resume Next" ignores it and continue with next line of code.
On Error Go to 0:
On error got to 0 statement disables error handling we have previously enabled it by using On Error resume Next.
err.number and err.description:
Provides the error number and the description of the error
Steps to follow to check application failure during Test Run.
Trigger Event steps:
Resources Menu --> Recovery Scenario Manager--> Click New--> Click Next -->Select Application Crash as Trigger event-->Next -->Select selected executable application-->Next --> (Continue below mentioned steps)
Recovery Operations and Post-Recovery Test Run Option Steps:
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 with “.qrs”
Error handling (on error resume next) vs Recovery Scenarios ?
If you can predict that a certain event may happen at a specific point in your test or component, it is recommended to handle that event directly within your test or component by adding steps such as If statements or optional steps or "on error resume next", rather than depending on a recovery scenario. Using Recovery Scenarios may result in unusually slow performance of your tests.They are designed to handle a more generic set of unpredictable events which CANNOT be handled pragmatically.
Example:
On error Statements
Following are error statements :
1. On Error Resume Next
2. On Error Go to 0
3. err.number
4. err.description
On Error Resume Next:
On Error Resume Next statement enables the Error handling in the code.If there is error in the code "On error Resume Next" ignores it and continue with next line of code.
On Error Go to 0:
On error got to 0 statement disables error handling we have previously enabled it by using On Error resume Next.
err.number and err.description:
Provides the error number and the description of the error
very well explained.. thanks a lot.
ReplyDeleteIt's very useful
ReplyDeleteQTP Book
tnanks
ReplyDeletemore than enough....thanks alot
ReplyDeleteIf example was given then it would have been more easy to understand
ReplyDeleteGreat and useful article. Creating content regularly is very tough. Your points are motivated me to move on.
ReplyDeleteSEO Company in Chennai
Amazing article. Anyway thank you for sharing this nice information through this.
ReplyDeleteSEO Company in Chennai
This comment has been removed by a blog administrator.
ReplyDeleteAmazing Articles, great work.
ReplyDeleteMobile Training in Chennai
The Recovery Scenarios in QTP are explained well my sincere thanks for sharing this post Please Continue to share this kind of post
ReplyDeleteSoftware Testing Training in Chennai
nice blog has been shared by you. before i read this blog i didn't have any knowledge about this but now i got some knowledge so keep on sharing such kind of an interesting blogs.
ReplyDeletesoftwaretesting training in chennai
Best Digital Marketing company Anantapur
ReplyDeletehelpful information, thanks for writing and share this information
Best Digital Marketing companyTirupati
ReplyDeleteGreat Information, Thanks for sharing
Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this.
ReplyDeleteReactJS Online Training
You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us
ReplyDeleteTableau online training
Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article. thank you for sharing such a great blog with us.
ReplyDeleteSql server dba online training
We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. ανακτηση δεδομενων
ReplyDeleteReally informative blog for all people. Thanks for sharing it.
ReplyDeletepearson vue test center in chennai
German language training in chennai
french classes
IoT Training in Chennai
Xamarin Training in Chennai
Node JS Training in Chennai
Informatica Training center in Chennai
spanish institute in chennai
content writing training in chennai
Great Article. Thank you for sharing! Really an awesome post for every one.
ReplyDeleteIEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.
JavaScript Training in Chennai
JavaScript Training in Chennai
Your blog is too much amazing. I have found with ease what I was looking. Moreover, the content quality is awesome. Thanks for the nudge! kak da otslabna v bedrata s uprazhneniya
ReplyDeleteInteresting stuff to read. Keep it up.
ReplyDeleteAdidas showroom in madurai | Woodland showroom in madurai
Puma showroom in madurai | Crocs showroom in Madurai
Thanks for sharing such a great blog
ReplyDeleteVermicompost Manufacturers | Vermicompost Suppliers
Vermicompost in chennai | Vermicompost manufacturers in Chennai
Thanks for sharing such a useful blog. Really! This Blog is very informative for us which contains a lot of information about the Writing. I like this post.
ReplyDelete