For
Qtp
Of
Reporter
Object.
Registeruserfunc
Methods, like rewriting other test object methods to customize our own
Reporter
Object and register it.
However
Yaron Assa
Here is a solution:
Http://www.advancedqtp.com/community/blogs/yaron-assas-blog144/overriding-qtps-native-reporter/
This method writes
Reporter
Class with the same object name:
'Override it with our custom class
Dim reporter
Set reporter = new clsreporter
'Define a funnel function to be called from
The test actions
Public Function getreporter
Set getreporter = Reporter
End Function
'Class Definition
'In the example, our class just reporter
A text file
Class clsreporter
Dim ofilereporter
Public sub reportevent (istatus, sstepname, sdetails)
Ofilereporter. appendalltext "C:/log.txt", istatus &"
: "& Sstepname &"-"& sdetails & vbcrlf
End sub
Private sub class_initialize
Set ofilereporter = dotnetfactory ("system. Io. File ")
End sub
End Class
Then
Action
Definition
Reporter
And get the object to use, so that
Reportevent
The method is our custom method, instead
Qtp
Of
Reportevent
Now:
Dim reporter
Set reporter = getreporter
Reporter. reportevent
"Fail", "stepname1", "stepdetails"