I've just written a whenever function to listen for whenever a critical error occurs in our application, then I want it to capture the stacktrace of the error and save it.
my code goes like this:
Private Sub Script_Whenever(ByVal TheEvent As TPEvents.TEventGroup)
If TheEvent.Name = "Critical_Error" Then
Dim captext As String
'attach to error window
DotNETForm("Sage Practice Solution Error DotNETForm").Attach
'attach to text box which contains the error text
'capture the error text
captext = GUIObject("Name=textboxDetails ClassName=WindowsForms10.Window.*").CaptureText
MsgBox (captext) 'display the error just to check
TestLog.Comment (captext) 'write to log ....but it doesn't in fact do this.
I don't know why it is not writing anything to the log? Any ideas?
ok, ignore this, I'm completly wrong. It is there, but it is in the command details pane, which leads me to the next point.
Can I put it into the log details part as it will be easier to read a longer stack trace from the panel at the bottom, and also copy and paste it into our issue tracking.