Reporter object in UFT

Reporter Object is used to log the messages in UFT test result (report). Reporter object has one method – ReportEvent that can be used to log the messages in results. Here is the syntax of this method.
 
Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath]

EventStatus can take any of the below values
  • 0 or micPass:
  • 1 or micFail:
  • 2 or micDone:
  • 3 or micWarning:
Also note that last optional parameter allows us to embed the screenshot in the UFT report. Reporter object has also got another method that can be used to send the HTML log in report. Below code shows how to use both the methods.
 
Reporter.ReportEvent micFail, "step","Description"
Reporter.ReportHtmlEvent micDone, "html step", "<b>This will be printed in bold</b>"

Reporter object has below Properties. Filter – allows you to filter the messages displayed in report. By default all types of report events are displayed. But you can restrict which events to be displayed using this property. Reporter.Filter can take any of the below values.
  • 0 or rfEnableAll
  • 1 or rfEnableErrorsAndWarnings
  • 2 or rfEnableErrorsOnly
  • 3 or rfDisableAll
ReportPath – Allows you to view or modify the path where report is saved RunStatus – Checks the test status. The Runstatus is failed when at least one report event of failed type is reported.

Web development and Automation testing

solutions delivered!!