Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
On Error Statement in QTP
#1
Not Solved
How I can use On Error GoTo functionName statement in QTP. I don't want to use Resume Next and If possible recovery scenario also. I tried with recovery scenario by calling Function name from VBS file on any error. But it seems function nae that I defined in VBS file is nnot getting displayed in the drop down. Any help will be appreciated. Thanks.
Reply
#2
Not Solved
See below example, hope this will help you to call error handling code in case of any error, make sure that error handler should be in the file where you called on error goto statement:

Code:
Public Sub InitializeMatrix(ByVal Var1 As Object, ByVal Var2 As Object)
   On Error GoTo ErrorHandler
   ' Insert code that might generate an error here
   Exit Sub
ErrorHandler:
   ' Insert code to handle the error here
   Resume Next
End Sub
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Executing statement and commiting statement via qtp unbeliever 6 20,527 01-07-2010, 07:11 PM
Last Post: unbeliever
Toungue "Coninue" statement in QTP caze 3 9,514 12-16-2009, 03:06 PM
Last Post: venkatbatchu

Forum Jump:


Users browsing this thread: 2 Guest(s)