Brother that's what I also intend to do but then do we error IDs available for QTPs general errors: (1) Object was Not found/ object don't exit on page (2) Object Not Defined (3) More than one object exist on page with similar properties (4) General Error
Now whenever such an error gets invoked qtp shows it and if you handle it via Recovery or code it stops the run which breaks the regression execution there itself. Say there were 200 scripts lined up for execution and all were whole sole independent scripts. And the 50th script got an error Object not Found then the recovery/code will handle error but it will stop the execution there itself. Do you think under that condition "On Error Resume Next" statement will not let execution stop and will take execution to 51st script to execute? On Wed, May 23, 2012 at 7:41 PM, Anish Pillai <[email protected]>wrote: > You can try using On Error Resume Next inside a function to capture the > error. At the end of the function, you can write the code to handle the > error. See the below sample function. > > *Function fnYourFunction() > On Error Resume Next > '---Your Code > '---Your Code > '---Your Code > > If Err.Number <> 0 Then > 'Handle the error > End Function > End Function* > > * > Cheers, > a n i s h > > [QTP > Tutorial]<http://www.automationrepository.com/tutorials-for-qtp-beginners/>| > [VBScript > Tutorial]<http://www.automationrepository.com/category/qtp-and-vbscript-tutorials/>| > [QTP > Blogs] <http://www.automationrepository.com/qtp-blogs/> > > ** > [** Subscribe to Get New Posts in your Inbox > **]<http://feedburner.google.com/fb/a/mailverify?uri=automationrepository/feeds> > * > > > -- > ar > > > -- > You received this message because you are subscribed to the Google > "QTP - HP Quick Test Professional - Automated Software Testing" > group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/MercuryQTP?hl=en > -- You received this message because you are subscribed to the Google "QTP - HP Quick Test Professional - Automated Software Testing" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MercuryQTP?hl=en
