Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath]
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
EventStatus Number or pre-defined constant 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.
ReportStepName String Name of the step displayed in the Test Results window.
Details String Description of the Test Results event. The string will be displayed in the step details frame in the Test Results window.
ImageFilePath String Optional. Path and filename of the image to be displayed in the Results Details tab of the Test Results window. Images in the following formats can be displayed: BMP, PNG, JPEG, and GIF.
Notes:
Images cannot be loaded from Quality Center.
Including large images in the test results may impact performance.
If an image is specified as a relative path, QuickTest will first search the Results folder for the image and then the search paths specified in the Folders pane of the Options dialog box.
To retrieve the mode setting:
CurrentMode = Reporter.Filter
To set the mode:
Reporter.Filter = NewMode
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.
The following example uses the Filter property to report the following events in the Test Results: 1, 2, 5, and 6.
Reporter.ReportEvent micGeneral, "1", ""
Reporter.ReportEvent micGeneral, "2", ""
Reporter.Filter = rfDisableAll
Reporter.ReportEvent micGeneral, "3", ""
Reporter.ReportEvent micGeneral, "4", ""
Reporter.Filter = rfEnableAll
Reporter.ReportEvent micGeneral, "5", ""
Reporter.ReportEvent micGeneral, "6", ""
Retrieves the folder path in which the current test's results are stored.
Path = Reporter.ReportPath
Retrieves the run status at the current point of the run session
If Reporter.RunStatus = micFail Then ExitAction
No comments:
Post a Comment