QTP/UFT Reporter Filter

Reporter.Filter= value
The value contains one of the following built-in variables.
 
1-rfEnableAll- Report all steps. The default setting
2-rfEnableErrorsAndWarnings- Only report error(failed)and warning steps.
3-rfEnableerrorsOnly- Only report error steps.
4-rfDisableAll- Does not report any steps.
The following code shows how to suppress a single checkpoint’s Pass/Fail status:
‘Store the Old filter value’
OldFilter=Reporter.Filter
 
‘Disable reporting of all events’
Reporter.Filter=rfDisableAll
 
Set op=Browser(“Browser”).Page(“page”)
chkStatus=op.WebEdit(“Username”).Check(Checkpoint(“username”))
if chkStatus Then
Msgbox “Passed”
Else
Msgbox “Failed”
End if.

 

see here too:

http://www.mindfiresolutions.com/Filtering-Steps-in-a-Report-in-QTP-1307.php

http://qtp.blogspot.co.il/2009/02/qtp-reporter-filter.html

How to use HTML in Report output

Hi,

when using the Reporter.ReportEvent method, all we can insert is simple text strings.

No HTML code would pass through (you’ll get a string with HTML tags in the output XML).

But there is a way to use HTML in the report, so the Result Viewer (or other viewers) would show it.

first, we need to write function that make it possible:

Function HTMLReport(strStatus, strStepName, strMessage)
Set objDict = CreateObject(“Scripting.Dictionary”) ‘ a dictionary object
objDict(“Status”) = strStatus ‘ set the object properties
objDict(“PlainTextNodeName”) = strStepName
objDict(“StepHtmlInfo”) = strMessage ‘here is where the HTML code goes
objDict(“DllIconIndex”) = 206
objDict(“DllIconSelIndex”) = 206
objDict(“DllPAth”) = “C:\Program Files\Mercury Interactive\QuickTest Professional\bin\ContextManager.dll” ‘of course, you need the right path of the bin folder

objDict(“DllPAth”) = Environment(“ProductDir”) &  “\bin\ContextManager.dll”

Reporter.LogEvent “User”, objDict, Reporter.GetContext ‘report the custom HTML
End Function

now, all we need is to call that function with the appropriate parameters:

strHTML  = “<TABLE border=1><TR><TH>This is <b>QTPQA</b> blog!</TH></TR>”
strHTML = strHTML & “<TR><TD>Sunday</TD></TR>”
strHTML = strHTML & “<TR><TD>Monday</TD></TR>”
strHTML = strHTML & “<TR><TD>Tuesday</TD></TR>”
strHTML= strHTML & “</TABLE>”

‘and the call to the function:

HTMLReport micPass, “HTML Report Example”, strHTML

and this is what you get:

HTML in Report


Have fun!