Micro Focus QTP (UFT) Forums
Error Handling - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Error Handling (/Thread-Error-Handling)



Error Handling - kanimozhi - 01-28-2008

Hi Angur,

We have to use Error handing in our qtp frame work. we are using keyword driven frame work.can you give one examble code for error handling? please, urgent.


RE: Error Handling - Ankur - 01-28-2008

Well my name is Ankur ...

For error handling...we need to know the type of error you are expecting... if you know before hand an error can occur at certain point of the script you can use "On Error Resume next" and then use err object as per your requirement OR if you don't know at which point your error may occur,during execution of script, you should use Recovery Scenarios.


RE: Error Handling - kanimozhi - 01-29-2008

Hi Ankur,
Thank you very much. Your blog and articals are very useful to us.Actually we want good error handling in professional qtp framework. We are using "On error Resume Next" and capturedesktopimage and report.filter to report the error message to qtp output file. Apart from this, we want better error handling.Can you give sample code for good error handling?. How we improve our frame work with better error handling? can you tell me about Err.object? we tried On error goto 0, On error goto <label>: qtp is not recognized these.


RE: Error Handling - esha - 01-29-2008

Hai Ankur
You are doing Great job.I read some matrial from this forum. it is really very nice and helpful.
In our company we are going to implement the framework.I am using on Error Resume Next for error handling. But compare to our coding these lines are more. For this pupose Java has try-catch block. (if error occur in block of code it automatically call one error handling function)same like is there any posibility in QTP. can we simulate same functionality here. can u help me for this.it will be helpful for me.


RE: Error Handling - deepakmehta82 - 02-26-2008

Hi Esha,
In java,you use Try-catch block where you have doubt or where you find any possibility to get error,beforehand.Similarily,in QTP also you can use Err object wherever you feel that you might get error.The basic purpose is same.It will simply move the control out of that error part.