Micro Focus QTP (UFT) Forums
Exception handler parameters - 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: Exception handler parameters (/Thread-Exception-handler-parameters)



Exception handler parameters - Ashok Kumar - 12-09-2011

Hello guys

I am using the below function (which is there in my Lib) mapped in the QTP exception handler to overcome any kind of error that happens in the AUT
at run-time. This function will simple mark the test as “Aborted due to application crash or object recognition problem” and carry on
with execution of next action which is in pipe line.

I am using Object.GetToProperty() to capture the object details which caused the error, but I am unsure of how to use
Rest of the parameters like “Method”, “Arguments”, and “retVal”

Some help on this would be much appreciated.

'************** This is my function *************************
Code:
Function Application_Crash(Object, Method, Arguments, retVal)

DataTable("Error_Source", dtGlobalSheet) = "(Name = " & Object.GetToProperty("name") & ") - " & " (Type = " & Object.GetToProperty("type") & ") - " & "( HTML Tag = " & Object.GetToProperty("html tag") & ") - " & " (Inner Text = " & Object.GetToProperty("innertext") & ")"

Call Get_TestResult(Test_Name, "Aborted due to application crash or object recognition problem")

Call Kill_IE()

Call Launch_Application()

End Function 
'************* End of function **************************


RE: Exception handler parameters - supputuri - 12-09-2011

Hi,

The author of this function might have an idea of keeping all thin info like the method, Arguments and retVal but he never used them in the function. So probably you can pass then as empty stings ("") and the scripts will execute without any issues.

If you want to use all the above function inputs then we should know what type of framework you guys are using, so that we can provide a solution.

Let me know if you need any further info.