Micro Focus QTP (UFT) Forums
On Error Goto Label - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: On Error Goto Label (/Thread-On-Error-Goto-Label)



On Error Goto Label - pranjal - 09-14-2009

My QTP script looks like this:
On Error Goto ERR_Handler

ERR_Handler:
msgbox "error"

I have not recorded anything. I just want to try to use the above error handling logic. But I get syntax error for the first line - On Error Goto ERR_Handler

I don't understand why. any ideas?


RE: On Error Goto Label - Saket - 09-15-2009

This is not supported by VBScript and so not in QTP.
You can use 'On Error Resume Next' or 'On Error Goto 0' only in qtp scripts.


RE: On Error Goto Label - Neetha - 08-19-2015

Hi,

I would like to know what exactly QTP will do when 'On Error Goto 0' is given? Can you please explain? Is '0' the number of the qtp step?


RE: On Error Goto Label - cuongtv - 08-20-2015

Hi Neetha,

On Error goto 0 to turn off error handling flag.
See how: https://www.learnqtp.com/forums/Thread-What-is-the-difference-between-On-Error-GoTo-0-and-Err-Clear