Micro Focus QTP (UFT) Forums

Full Version: How to write scripts with error handling mechanism
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys,
I've to write automation script for web based application which will be run on IE, Chrome and FF. Can you help me with error handling code. For ex. if i want to capture screenshot of error and have it continue to next function. Can someone please give ideas on what i could do and how could i do it so any time i've errors, i can quickly and efficiently debug them?

Your replies are very much appreciated.

Thanks
whenever u want to capture a screen shot of error, then write a function when u recieve any error and use Desktop.capture.
for next line you can use On error Resume Next
Thanks Ankur!

But how can i do that if i've multiple actions in my script ?? Do i've to write that code for every action or there's a more dynamic way to do this ?