Automated tests are created mainly to be run unattended, and this raises a few concerns for automation developers. Assume a situation where you initiated your test-suite while leaving your office to be run over-night. However, because of unforeseen errors, your test stops at a point and disrupts your results. When you return to your desk the next day, only to find that your tests aren’t completely executed. This can be quite frustrating, and its crucial to be proactive and handle such errors before they impact your work.
This article discusses a way of creating a Recovery Scenario for an instance where an item in the list item or menu is not found.
In this example, we will define a Function Call and use that Function Call to handle the error. The default syntax for the Recovery Scenario Function is:
Function fnRecovery(Object, Method, Arguments, retVal) 'Error Handling Code End Function
Explanation of each argument to fnRecovery is given below:
Object as Object: The object of the current step. Method as String: The method of the current step. Arguments as Array: The actual method's arguments. Result as Integer: The actual method's result.
To handle this scenario, we will use the function below:
Function Recovery_ListItemIsNotFound(Object, Method, Arguments, retVal) Dim sAllItems, arrAllItems, intItem With Object 'Retrieve all items from the Listbox sAllItems = .GetROProperty("all items") 'Split 'all items' using a delimiter ";" into an array arrAllItems = Split(sAllItems, ";") 'Select a random number intItem = RandomNumber.Value(LBound(arrAllItems), UBound(arrAllItems)) .Select "#" & intItem Reporter.ReportEvent micInfo, "ListItemIsNotFound", "Item: " & .GetROProperty("value") End With End Function
Recovery_ListItemIsNotFound, as the same suggests, executes the Recovery Operation if the list item that we supplied to our target WebList does not exist. This is quite common in Web applications, and Items in a WebList can change depending upon the input(s) provided.
To start, Click Resources -> Recovery Scenario Manager. You should see a window like this:
In the window, click the following button:
Doing so will invoke the Recovery Scenario Wizard:
When the window above opens:
- Click Next
- Select Test Run Error as the Trigger Event
- Click Next
- Select ‘Test Run Error: Item in list or menu not found in the Error Listbox
- Click Next twice and navigate to Recovery Operation
- Select Function Call and Click Next
- Select a library which will store our Recovery Function.
- Select ‘Define New Function’ and in the TextArea, paste the function Recovery_ListItemIsNotFound
- Click Next
- Make sure ‘Add Another Recovery Scenario’ Checkbox is not selected and click Next again.
- Under Post-Recovery Test Run Options, select proceed to next step.
- Give your scenario a name and Click Next
- And finally, Check the following option: Add Scenario to current test and Click Finish. Save Changes before closing.
We will use the WebList below to select a value that does not exist in it; so, let’s write a code to select Rational Robot. If you view the items present in the listbox, you will notice that Rational Robot indeed doesn’t exist, but our Recovery Scenario will handle the error when we select it. Instead, it will select a random value from the list.
Browser("title:=.*Recovery Scenario.*").Page("micclass:=Page")_ .WebList("name:=testTools").Select "Rational Robot" MsgBox "Item Selected: " & Browser("title:=.*Recovery Scenario.*").Page("micclass:=Page")_ .WebList("name:=testTools").GetROProperty("value")
When the code above executes, you will notice that, instead of throwing a Test Run Error, a random value from the list box was selected. You will know that the Recovery Scenario was triggered and ran successfully when you view the Test Results:
There are plenty of other scenarios as well, and I will try to cover some of the important ones. If you have any suggestions, or a scenario that you would like me to cover first, please use the comments section of this post to share your ideas/thoughts with me. Thanks! :)
{ 98 comments… read them below or add one }
Hi,
I am getting an pop-up window while executing the test. Script has to close that window to proceed to next step.
Please help me with it.
Thanks in advance.
Hi Anshoo,
Can u pls tell me how to create recovery scenario to stop QTP script execution when application on which we are running the script goes down.
S Singh, the recovery scenario you design for this can just have ExitTest in it. If the RS runs, it will simply exit the test. If it goes down because of issues that you can control, I would recommend Conditional logic or On Error Resume Next instead.
Hi Anshoo,
I am running QTP scipts in night without monitoring it. So whenever my application goes down, QTP continues running and gives wrong results. What I need now is that a recovery scenario be created for this so that whenever application goes down due to any reason (which is not under my control), QTP should get stopped.
Please suggest.
Hi Anshoo,
my problem is when I am calling recovery function in wizard which already exist in library,after selecting “select function” radio button I dont see any function in list from that function library(here I m not using “define new function” radio button).
Please suggest.
Piyush, you will see the function in the list if it meets the criteria for it to be a RS function – that is, it must have the required args. Example:
Function SomeFunc(Object) 'code End Functioncan you please give some more example for recovery scenario because i tried for pop up window and object state. . . so please give some simple example for objects present in the application. . .
Hi Anshoo,
Code I have written for recovery scenario is as below:
Function Recovery_ObjectNotFound(Obj, Method, Arguments, retVal)
msgbox err.number
msgbox err.source
msgbox err.description
End Function
But when this function is executed then msgbox shows 0 for error number and blank for source and description. It means that err object is getting reset. As on next line in script also same values are shown
Hi Anshoo,
I am new to QTP, some times i get Object not found test run error from QTP. In my script I have added some checks which skips rest of lines if any step fails, but if i get an error like this I would like to log it in my result array so that it will be present in my report excel. SO can you tell me how to capture those errors and their bodies? and also custom function which I have written to record my results can be called from recovery functions to log results in my result array?
Amit, a very good way to avoid “Object Not Found” is by using the .Exist method.
hi,i saw this example but am having one doubt ‘#” this one is used in script am not undestand this one….
Dear Anshoo,
I have a problem with my framework. Hope u can give a appropriate solution regarding Recovery Scenrios.
–suppose I am going to execute 20 test cases through the driver script with the Execution_Flag=Y defined in Test Data sheet.
–for each scenario, I am maintaining a Environment Variable to capture the Scenrio_Name and Result like :
—–Environment.Value(“strResultparam”)=StrScenarioName1 & “|” & strResPassVal (If this case is passed)
—-Environment.Value(“strResultparam”)=StrScenarioName1 & “|” & strResFailVal (If case is failed)
at the end of 20th test case execution, the environment variables would be like:
>Environment.Value(“strResultparam”)=Environment.Value(“strResultparam”) & “##” & StrScenarioName1 & “|” & strResFailVal
–Like:::Environment.Value(“strResultparam”)=verifyLogin|Pass##verifyHomePage|Pass……………………VerifyAddUser|Fail…..and so on..
>>Now at the end of 20th test case execution, I am calling a “Fn_WriteResult” function in which I am passing this Env. variable as a parameter.
>>In This function, I have written a code which will seperate the Env. Variable on the basis of ## and will return an array like below:
Public Function fn_WriteResults1(byval strRes)
ArrTestData=Split(strTestData,”##”)
And after that, I am just entering the elements of this array into an excel sheet like below:
—————————————————————
ScenarioName Result
verifyLogin Pass
verifyHomePage Pass
‘
‘
‘
‘
VerifyAddUser Fail
—————————————————————
Now my problem is, in this approach: I am collecting values and concatenating the multiple values on the basis of test case scenarios and Pass/Fail result.
But Suppose, some of the sceanrio(suppose 5th scenario) is not able to execute just coz of Object not found error or any run time error. Hence I need to ignore that step and want to come to the next step so that, my env variable collection would not corrupt.
Please suggest any solutions, How can I avoide such run time errors. Can I use On error/Go to 0 for each scenarios?
or any other solution?
Once all the scenarios have been executed
Naveen: depending on how you have created your framework (actions vs. function libraries) you can use a Class_Terminate() event to run after each actions completes. I am providing some sample code, but please modify it for your usage:
Class ActionTerminate Private Sub Class_Terminate() If Reporter.RunStatus = micFail Or Err.Number 0 Then Err.Clear Environment.Value("strResultparam")=StrScenarioName1 & "|" & strResFailVal Else Environment.Value("strResultparam")=StrScenarioName1 & "|" & strResPassVal End If End Sub End ClassAnd yes, please use Error Handling where required: Conditional statements, On Error Resume Next, Recovery Scenarios etc.
The way of explaining the “Recover operation-Function call” is good
Thank u
Hi Anshoo,,
In my office for eavry 18 mins the system will be automatically locked if it is ideal for that much time. Is there any QTP script to avoid that tipe of situation to run the Scripts continuosly please let me know.
Thanks in advance
Dhana: Please see here
Hi Friends,
I want QTP scripts for following scenario:
When we are executing QTP scripts some times it will fails at that time i want to take a screenshot of runtime error and need to be stored it some spceific folder and then i want to kill my application and need to reopen it.
Can anybody help me to solve this issue.
Thanks in advance.
Dhana: There are several ways you can achieve this and there is a technique I love a lot, which is from Tarun’s book – which I can’t share with you at this point of time. We must wait until it is officially published. In the meantime, you can try the following:
Public Sub OnEventFail(ByVal capturePath, ByVal terminateApp) If capturePath <> "" Then Desktop.CaptureBitmap capturePath, True End If If terminateApp Then 'depending on type of app, execute terminate procedure End If End SubHi Anshoo,
Thanks for this valuable post. I have written a recovery scenario function to capture the screenshot on error. But I am getting The function is not found error at run time.
It will be great if you provide the solution to my problem. The function is as below.
Function RecoveryFunction1(Object, Method, Arguments, retVal)
Desktop.CaptureBitmap(“c:\Error.png”, 1)
End Function
Waiting for your replay.
Thanks & Regards
Shivu
Shivraju: Is the function stored in a library? If yes, then is the library associated with your test?
how can i create Recovery Scenario for Application Crash.When running the script IE crashes sometimes.How can i handle this with Recovery scenario.
Please help me
How do we pass values between actions in one test other than by action call?
Say for eg, if action_1 contains a variable ‘C’ containing the value of a+b, how can we display the result (value of ‘C’) in action_2 ?
Vikram: You can either create a the variable
Cas a global variable, or an Environment variable. Either way, you will be able to see the value it stores in any of the actions.I have one doubt that ” When to user Update Run mode”
reply the answer to my mail vyedavelli@gmail.com
and also why it is needed
Hi in the above ListItemnotfound recovery, the object properties are accessed using .getropropery(). But when i was using the same for AnyError, i am getting “General error”. Can any one let me know how to access the “Object,Method,Arguments and retval” with examples.
My requirement is to display message (like object name, method name, arguments and retval) in the recovery scenario function for “AnyError”.
So when QTP encounters any error, it will invoke the recovery scenario which inturn the function and then it displays the message in the message box with details like object name, method name, arguments and retval. The user will click on ok button and the post recovery operation will be invoked bye the recovery scenario.
Hi Anshoo,
Your style of explaining the things is very good even a novice user can understand.
i have one question for you, if i have 10 recovery files, how do i make sure that based on that particular instance i call the particular recover file.
for example:
1.recoveryfile1
2.recoveryfile2
….
recoveryfilen
error message which requires recoveryfile2 to handle
error message which requires recoveryfilen to handle
is there any mechanism to handle this?
Hi Deep,
How many ever recovery scenario files you created, you just need to add all of them to the required test. As per the scenario demands, i.e, when there is any unexpected exception, automatically QTP checks for an appropriate recovery scenario out of the one’s attached to the test. This is the actual thing expected out of a recovery scenario.
To my knowledge, there is no specific mechanism defined to handle this.
Please correct me if I am wrong in any sense.
Thanks :-)
Thanks!very useful
Hi,
I would like to create a recovery scenario for a Pop-up window that might appear when I click any button on my web app.
However, since I do not want to enable this recovery scenario for after every step beacuse of performace slow down issues. Is there a way to enable it only after any step that clicks on a button/image?
1) How to write a script for recovery scenario through descriptive programme.
For example
1) A pop-up Internet explorer has open after login to the account.
This is the script
Browser(“Google”).Window(“Internet Explorer”).Page(“Internet Explorer”).WebButton(“OK”).Click
3) I have written it in descriptive programme.
4) But QTP Tool is not recognize it for a long being time.
OR
Given me one example how to write Recovery scenario using scripting.
Hi Anshu,
One doubt about the way QTP treats the application when a recovery scenario is triggered.Does the recovery scenarios follow strict rules when the post recovery options are applied on them.
Problem in detail:
– Action1 (Encountered error – Recovery Scenario triggered)
Step1
Step2
– Action2
When I choose post recovery operation as ‘Skip to next Action’.
Does it work properly or QTP tries to execute the steps after the Action1 (where recovery scenario is executed)
Venkat,
When the action is complete and the RS enters the Post-Recovery phase, it will automatically implement Action2 and stop execution of Action1 from the point where it was triggered.
Hi,
I am using the QTP Trial version, where i has install and UnInstall the software after unstalled the software.
Now the Record and Playback functionality of QTP is not working properly whenever i do to record and playback any web or window application; blank script is running. let me know it ‘s happing.
Thanks :)
Hi,
Very informative and detailed way of explaining the scenarios. Appreciate the way you presented it. Here in the example, WebList object is static and present always on page. So, we can use Test Run Error and call a function. My scenario is different. When I access any website, security dialog pop-up (WebSense) comes up and I need to enter my Username and Password and click OK. This Websense may pop-up anytime(no specific time) after that as long as we are browsing and browser is open. Everytime I need to enter values and click Ok. This can be handled only through Function call and select Popup-Window in recovery scenario. Could you pls give an detailed example like above? I am struck at this point. Thanks in advance.
Hi,
I have a little problem with the recovery scenarios, I saw that all the arguments are getting lost after finish the recovery scenario, do you know if there is a way to use one of these arguments, for example retVal?
Thanks
Victor,
Do you mean after the RS is triggered, and ran completely? You can create a global variable to store the value or use an Environment variable..
Hi,
I created a recovery scenario for “object not found” but still qtp is throwning an error instead of calling recovery function..can you help me on this
Kiran,
Have you configured your Recovery Scenario in the Test Settings to run on every step? Also, what did you select as the Trigger condition?
Hi Anshoo,
I am regular follower of your site.I learned a lot.Actullay my problem is in my application there are 5 to 6 edit boxes which will take defferent data means one box taking alphabets and other one will take alphanuemaric.total test data is data driven.if i send any improper data an error message is getting displayed.I want to handle this with REcovery scenario.(if i give improper data also it will take properdata )my aim is script will not stop with respect to data.Can you give me any idea how to handle this
waiting for your responce
Thanks
What kind of error does the application throw if invalid data is entered? You can create a Recovery Scenario function with the business logic to handle this kind of error – however, you must make sure there is a trigger event to this operation because Recovery Scenarios will not work without a trigger event.
Hi Ansoo,
Any idea about How to add a function lib relatively with a recovery scenerio
Regards
Hi Preeti,
You can associate function library to a recovery scenario from the Recovery Scenario wizard available in QTP. Once the trigger event is set we can add corresponding recovery scenario operation to be executed upon the trigger event (Add respective Function in .qfl file – in Recovery Operation – Function call wizard)
Regards,
Venkat…
Thanks Venkat :)
Hi Anshoo,
I want to associate the following function with my recovery scenario via function call. and then proceed to next action iteration.
However qtp accepts only accepts (Object, Method, Arguments, retVal) arguments.
Is it possible to associate the following function. Please suggest a way to do this.
Function CloseAllBrowsers()
Dim WshShell, oExec
wait(2)
Set WshShell = CreateObject(“WScript.Shell”)
Set oExec = WshShell.Exec(“taskkill /f /im iexplore.exe”)
wait(2)
End Function
Please reply soon….Very urgent
Thanks,
Vishal Jhaveri
Hi Vishal,
Try this:
Function CloseAllBrowsers(Object, Method, Arguments, retVal) Dim WshShell, oExec wait(2) Set WshShell = CreateObject("WScript.Shell") Set oExec = WshShell.Exec("taskkill /f /im iexplore.exe") wait(2) End FunctionHi Anshu,
I have a small doubt related to recovery scenarios. Actually QTP does not support calling actions in any functions. But can I manually point to an action in a recovery scenario function. Such that when recovery is been kicked it has to run the specific function which internally executes an action.
Is this supported. If so are there any other side effects on using using this. If not supported how can we call an action when a recovery is been called.
Please help me out in this.
Thanks,
Venkat
It can be done through
RunAction. Not sure if there will be any side affects; it depends on your action. What if the RS is triggered several times in your test? Would you like the Action to be called each time?Thanks a lot Anshoo, Sophie
:)
Thanks a lot Anshoo, that makes from grey to white, I made this duplicate submission as there was some problem with the submission, i don’t know how to delete it?
I have one more general doubt, Is there any posibility to run several test at a time thru QTP? If yes, could plz guide.
Could you plz even suggest some referal for learning QC.
Thanks in advance!, the word “thank you” is not enough for this kind of support you are giving to people like us, i got lot of hope and motivation after looking this site interms of learning QTP. If possible, please help us to get some knowledge on Vitual Objects, AOM,DOM..etc
Thank you ,
Sophie
Sophie,
I have removed the duplicate comment.
To run several tests through QTP, please see this POC from my dear friend Meir: http://www.advancedqtp.com/forums/index.php?topic=197.msg864#msg864
Hi Anshoo,
I was just looking this kind of example to understand the recovery scenario, Thanks a lot , U r post are so wonderful and gift to all desperate learners of QTP.
Could you please help me out in this?
1. In above script what is the path mentioned in screen shot No. 7(top to bottom), Function Library(which is existing, where can we get this from?
2. how does these 2 options differs?
1. Add scenario to current test
2. Add scenario to default test settings
3. Does save settings will save the written function in function library.
Thank You,
Sophie
#1. You can create a
.VBS/.QFL/.TXTfile and use that file to load your Recovery Scenario function.#2.1. Adding it to the current test means, it will be used with the current test only.
#2.2. Adding it to the default test setting means, it will be used with all tests created on your machine.
#2.3. Yes.
:)
How to parameterise the Recovery Scenario files into the Driver Script?
How to redirect the Test Result to the Excel sheet?
Please let me know at the earliest….
Thanks,
-Lohith
Parametrize a Recovery Scenario? Not sure I understand..
You would like to export all steps, or only the status? With QTP 10, you can export results to an HTML file, .DOC and .PDF files through the Result Viewer facility itself.
Hi Anshoo,
When i start browsing your blog my time pass so fast and you have so good examples, solution where i do suggesting my jr.qa to your blog.Thanks so much and all the information so helpful.
Thanks,
Princess!
Thank you! I’m glad you found the content on RelevantCodes helpful. :)
By the way, finding/selecting an list item is especially a problem with QTP 10 and doesn’t work with SAPList objects:
Browser(“ABC”).Page(“ABC”).Frame(“ABC”).SAPList(“001″).Select “04″
and the error message is cannot identify 04 element of SAP List 001. Check if it is available in list of all elements.
I haven’t found any solution, maybe someone else has a workaround or helpful answer fixing that problem.
Thanks in advance!
Hi Stefan,
I haven’t had a chance to work with SAP, but I hope someone reading this comment section may be able to help. Consequently, you can even refer to one of the forums to have your query answered.
I asked this same question in SQAforums.com :)
I was wondering if that was you on SQAForums. :)
I am using QTP 9.2. After I clicked Resources -> Recovery Scenario Manager, Recovery Scenario window is displayed. And in this window the “New” button on the does not work. Hope you noticed it. I don’t know if they fixed it QTP 10 version.
Ramesh,
You’re absolutely correct, and this is the same in QTP 9.5 as well. I’m not sure that that button is supposed to do, since there is a seperate buttom right underneath it to create a new scenario.
Hi Anushoo,
One of my friend said creating recovery scenario will eat time and will lead to performance issue??? How far it is true. Guide me Anshoo.
Thanks
This may be true, but I have never tested the performance of my scripts with and without the Recovery Scenarios I use, so, I can’t be entirely sure of this. I think a little bit of performance impact is not a problem as long as my Recovery Scenarios are bridging the gap between the bugs I create in my code :)
I created around 20 QTP scripts. While creating them i didn’t know about recovery scence.
Know I created one Recovery Scenario, but I want it to applicable to all earliar 20 sceipts.
How can I do this.
Pease help me.
Hi Raj,
There are 2 ways this can be done:
1. Use AOM to associate your Recovery Scenarios with Tests. See here. The only way you can add Recovery Scenarios programatically is through an external VBS file as demonstrated in the link at SQAForums.
2. Manually associate them..
Thanks a lot Anshoo Arora. this code will simplify my life of constant error messages i receive due to object not found in the items list.
Thanks,
Syed
Thank you, Syed! I’m glad it helped.
Hi Anshoo,
I was just looking the kind of example to better understand the rs.You have Wonderfully explained the concept with relevant yet simple to understand example.Keep it up.Thanks a lot.
Regards
Amardeep
I’m glad it helped you, Amardeep. Thank you.
Hi Anshoo ,
I am new to qtp and until now i just know only tht pop up recovery scenario.Thank you very much for your time to prepare detailed description of this recovery scenario.This is defiantly very useful to everyone working on qtp.
One thing for me is not clear.Why are you selecting the item which is not in the list? When the item is not in the list why to select it?
Can you explain me where exactly we need to use this recovery scenario.
Hi Rathod,
Actually, this post is just a demo of how a function call can help in such situations with Recovery Scenarios. In reality though, the example stated in this post is a complete possibility.
Let’s suppose you are creating an automated test for a Checkout process of a Shirt. The test case says that you would Checkout an Orange color shirt for size “L”. In the selection list, generally there are 4 sizes: S, M, L, XL.
However, for an Orange Color shirt, only sizes “M” and “XL” are left. Sizes “S” and “L” are all sold out.
Now, your script runs and tries to find and select size “L” from the listbox. But, as we mentioned above that size “L” does not exist. Because of this dynamic behavior of the application, QTP will still try to select item “L” (which is not there). Instead, it will throw a run error and cause the script to halt.
However, because we have created this Recovery Scenario, it will choose either size “M” or “XL”, and move on. In other words, it will save us from something we did not expect – which is the core concept of a Recovery Scenario.
Hi Anshoo,
I like your articles a lot. Thank you for your effort to propagate the knowledge.
I have a question about Error Handling in QTP scripts. Do you ever use “On Error Resume Next” construct in your scripts? I look through most of your articles and cannot find any info on it. What do you think about it?
Thank you,
Petr
Excellent question, Petr.
Actually, I do use “On Error Resume Next” quite a bit. However, you do not see a lot of it in my articles because I feel its not an efficient way to handle errors, and even though I know people use it, I try not to reinforce its use :)
When the deadlines are tight and the pressure builds up, I feel I use it more then as compared to when things are going quite smooth, which gives me more time to make my code robust. I have a few functions that do a lot of error handling with simple Conditional Blocks, but a lot of my core code in my framework runs within On Error Resume Next statements.
Also, in short, the more generic my framework, the greater the use of it. However, that also means, it can become very difficult to catch an error which you would easily find, without its use.
Hi Anshoo,
I agree with you..we can associate recovery scenarios for any kind of scenarios as explained above ..
cheers
suni
Cheers, Suni :)
Hi Anshoo,
The usage of recovery Scenario is explained very clearly…the script wil fail again if the code depends on the selected list item which is not there in the list.Hence we run the suite that checks the master data first and then the main suite…
thanks
suni
Hi Suni,
How have you been?
Absolutely correct. However, if the script encounters such error again, it will trigger the Recovery Scenario (again). In other words, unlike our normal code which is Single Threaded, Recovery Scenarios work more like a Try…Catch mechanism.
Hi Anshoo,
i like ur articles a lot informative and wants some detailed information on Keyword driven framework and howz it can be implemented
Regards
Deepak
Hi Deepak,
Its quite hard to sum up the concepts and complexities of any sort of a framework that easily. However, you can find some information on Keyword-driven Testing here. Also, I would recommend you to visit AdvancedQTP’s KnowledgeBase and download FramworkManager. I’m sure these 2 sources will provide you ample information to begin with. If you have any questions in the meantime, please post here and I will try my best to help you.
PS. You should really check out FrameworkManager.
Thanks- Anshoo
Hi Anshoo,
I appreciate the work being done by you for the QuickTest newbie’s.Anshoo,as a member of AdvancedQTP forum, your solutions for the queries are very simple and easily understandable even for the newcomers. Great Job!
I am strated to learn QTP in my own way could please help me regrading below topics with screen shots or any vedio that is good for me.
please give me one real time example in using Inputparmeters and out put parameters in QTP and aslo explain the using mutiple action using those things I need step by step explanation could u please provide a soluation
Sure, Satish. I will try my best to help you. I don’t use QTP’s inbuilt parameters much, so I am not sure how good I will be able to explain it but I will try to write an article in the coming few days. Thanks.
Good example.I found it very helpful.Especially the time you took to explain it step by step by inserting screen shots.
Thanks a lot.
Thank you! I’m glad you found it useful. :)
It makes a lot of sense as always with your articles :-)
Thank you,
Thank you :)
Hi Anshoo,
could please give me one real time example in using Inputparmeters and out put parameters in QTP and aslo explain the using mutiple action using those things I need step by step explanation could u please provide a soluation.
Hi Satish,
I rarely use Input/Output parameters and my knowledge about this is quite rusty. However, I will try to post something about them in the near future.
Thanks :)
Hi Anshu,
I appreciate your interest in responding to the questions and your articles too….
I have a small doubt based on recovery scenarios. Here is the brief demonstration of it.
I have a piece of code which causes my script to fail (as it is known issue… I cant handle this through the script(constraint) ) I have written a recovery scenario(RS1) and it triggered properly when any error arises. Later I enhanced my script to capture my error which QTP throws during run time and depending on the error I want script to trigger recovery scenario (RS2). Is that possible …? (I have associated both the recoveries to the test…What I observed is it is running both the recovery scenarios whenever any error arises in the script).
One more doubt is how does ‘recovery scenarios’ differ from the ‘When error occurs during run session: Proceed to next step’
One question: If you can’t handle it through your script, how can you handle it through your Recovery Scenario? Wouldn’t the same code be applied in the situation where this constraint occurs?
It may be. I am going to do some research on this and get back to you, but my initial thought would be that this might just be possible..
When error occurs during run session: Proceed to next step is a subset of Recovery Scenarios. A Recovery Scenario has the functionality to let users to proceed to the next step when their core-recovery-scenario-action is performed.
Hi Anshu,
I can handle the script by modifying it (which is a hectic problem for me..I just want my existing scripts not to be modified but want them to be handled through recovery scenarios…). So I tried in this track for a better solution and found few problems which I have mentioned in my earlier post.
Thanks,
Venkat
Gotcha. I will try do some research on this and post my observations here. But, technically, what you’re trying to do should be possible..
Thanks Anshoo.. I did try with RunAction earlier and it worked fine for me..but because of this I got some problems in reporting mechanisms. Is there any other way where I can invoke an action in the function…?
Thanks,
Venkat.
Sure you can. The same process as you would do from a Function Library would be implemented here, but instead of keeping code loose, we’ll store it in a function so it only executes when the function is called. What issues did you have with reporting?
Thanks a lot…. it works with the environment variables
hi, this is harish from bangalore.
i’m using recovery scenerio for a pop up java window…
but its an alert action….it will come many num of times with a gap of less than a second…..
how much time will the qtp takes to identify the pop up window and to perfom the closing operation on that java window…..
or is there any other methods to handel this type of situation…that is
during test run ,a java window will come any any point of time,we need to close it as and when it comes and
the test should run smoothly.