Sunday, September 27, 2015

Reporter Object || Results Formatting

Description
The object used for sending information to the test results.
Associated Methods

  • ReportEvent Method
  • Syntax
    Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath]
  • Examples
    The following examples use the ReportEvent method to report a failed step.
    Reporter.ReportEvent 1, "Custom Step", "The user-defined step failed."
    or
    Reporter.ReportEvent micFail, "Custom Step", "The user-defined step failed."
    The following example uses the ReportEvent method to include a captured bitmap in the test results.
    Browser("Browser").Page("WebPage").Image("MyLogo").CaptureBitmap("MyLogo.bmp")
    Reporter.ReportEvent micDone, "Display Logo", "This is my logo", "MyLogo.bmp"
  • Status of the Test Results step:
    0 or micPass: Causes the status of this step to be passed and sends the specified message to the Test Results window.
    1 or micFail: Causes the status of this step to be failed and sends the specified message to the Test Results window. When this step runs, the test fails.
    2 or micDone: Sends a message to the Test Results window without affecting the pass/fail status of the test.
    3 or micWarning: Sends a warning message to the Test Results window, but does not cause the test to stop running, and does not affect the pass/fail status of the test. 
Associated Properties


  • Filter Property
  • Syntax
  • Reporter.Filter = NewMode
  • Reporter.ReportEvent micGeneral, "2", ""
    Reporter.Filter = rfDisableAll 
  • Mode
    Description
    0 or
    rfEnableAll
    Default. All reported events are displayed in the Test Results.
    1 or rfEnableErrorsAndWarnings
    Only event with a warning or fail status are displayed in the Test Results.
    2 or
    rfEnableErrorsOnly
    Only events with a fail status are displayed in the Test Results.
    3 or
    rfDisableAll
    No events are displayed in the Test Results. 

  • ReportPath Property
  • Description
    Retrieves the folder path in which the current test's results are stored.
    Note: Do not use this property to attempt to set the results folder path.
    Syntax
    Path = Reporter.ReportPath
    Argument
    Type
    Description
    Path
    String
    The folder path in which the current test's results are stored.
    Example
    The following example uses the ReportPath property to retrieve the folder in which the results are stored and displays the folder in a message box.
    dim Path
    Path = Reporter.ReportPath
    MsgBox (Path) 

  • RunStatus Property
  • Description
    Retrieves the run status at the current point of the run session. For tests, it returns the status of current test during the test run. For business components, it returns the status of current business component (not the entire business process test).
    Syntax
    Reporter.RunStatus
    Example
    The following example uses the RunStatus property to retrieve the status of the run session at a specific point and exit the action if the test status is fail. If the test status is not fail, the test run continues.
    If Reporter.RunStatus = micFail Then ExitAction

  • Source: QuickTest Professional Help 

No comments:

Post a Comment