Reporting Modes in UFT

Aneejian · May 21, 2015 · 2 mins read.

Reporting Modes in UFT

Reporter object in UFT has different reporting modes. This post discusses about various mode available in reporter object.

Reporting Modes

Available reporting modes in UFT are

Report Mode Description
0 or rfEnableAll All events are displayed in the Run Results. This is the Default report mode
1 or rfEnableErrorsAndWarnings Only events with a warning or fail status are displayed in the Run Results.
2 or rfEnableErrorsOnly Only events with a fail status are displayed in the Run Results.
3 or rfDisableAll No events are displayed in the Run Results.

Report Filter

You can use the Report.Filter method to determine which steps or types of steps are included in the Run Results. You can completely disable or enable reporting of steps following the statement, or you can indicate that you only want subsequent failed or failed and warning steps to be included in the report. You can also use the Report.Filter method to retrieve the current report mode.

Code Description
Reporter.Filter = rfDisableAll Disables reporting of subsequent steps.
Reporter.Filter = rfEnableAll Enables reporting of subsequent steps.
Reporter.Filter = rfEnableErrorsOnly Instructs UFT to include only subsequent failed steps in the Run Results.
Reporter.Filter = rfEnableErrorsAndWarnings Instructs UFT to include only subsequent Failed or Warning steps in the Run Results
myReportMode = Reporter.Filter Returns current Report Mode.

Sample Code

Dim myReportMode
reporter.Filter = rfDisableAll
PrintReportMode("rfDisableAll")
reporter.Filter = rfEnableAll
PrintReportMode("rfEnableAll")
reporter.Filter = rfEnableErrorsOnly
PrintReportMode("rfEnableErrorsOnly")
reporter.Filter = rfEnableErrorsAndWarnings
PrintReportMode("rfEnableErrorsAndWarnings")

Sub PrintReportMode(ByVal reportModeName)
 myReportMode = reporter.Filter
 print myReportMode & " - " & reportModeName
End Sub

The output of the above sample code would be

3 - rfDisableAll
0 - rfEnableAll
2 - rfEnableErrorsOnly
1 - rfEnableErrorsAndWarnings