Hi,
I'm new to QTP and have written a function to take a screenshot of an application window and add it to the QTP results file. Here is the code:
My problem is that the above code works, but my tests are marked as Fail because I use 'Reporter.ReportEvent micFail'. My screenshots get added to the report fine.
But - When use 'Reporter.ReportEvent micPass' or 'Reporter.ReportEvent micInfo', my screenshots get taken and saved, but don't get added to the report file.
Can anybody help me?
Thanks,
Jimmy
I'm new to QTP and have written a function to take a screenshot of an application window and add it to the QTP results file. Here is the code:
Code:
Sub CaptureScreenshot( ByVal strName, ByVal strWindow )
Dim path_error_file
path_error_file = "C:\" & strName
Window(strWindow).CaptureBitmap path_error_file,True
Reporter.ReportEvent micFail, object_snap, "&<img src='" & path_error_file &"'>"
End Sub
My problem is that the above code works, but my tests are marked as Fail because I use 'Reporter.ReportEvent micFail'. My screenshots get added to the report fine.
But - When use 'Reporter.ReportEvent micPass' or 'Reporter.ReportEvent micInfo', my screenshots get taken and saved, but don't get added to the report file.
Can anybody help me?
Thanks,
Jimmy