Relevant for: GUI tests and scripted GUI components
Message statements add notes to the run results, or to be displayed in the Output pane while running your test.
For example, you might want to add notes to the run results about the application tested, or operating system used. Or, send a message to the run results indicating that a particular object was missing during a specific step.
If you work with the HTML report, add a note by inserting a Reporter.AddTestInformation step in your test or component.
Reporter.AddTestInformation "Test status","Passed"
In the run results, this information is displayed in the run results summary.
If you work with the Run Results Viewer, add a note by inserting a Reporter.ReportNote step in your test or component.
Reporter.ReportNote "This test was run from 126.96.36.199 using a wireless connection."
The note is displayed in the Run Results Viewer on the Executive Summary page.
Send messages about specific steps to the run results by inserting a Reporter.ReportEvent step.
Example: Reporter.ReportEvent micFail, "Password edit box", "Password edit box does not exist"
In this example, micFail indicates the status of the report (failed). Password edit box is the report name, and Password edit box does not exist is the report message.
Use the following statuses:
|Causes this step to pass and sends the message to the report.
|Causes this step (and therefore the test) to fail, and sends the message to the report.
|Sends a message without passing or failing the step.
|Sends a warning status for the step, but does not stop, pass, or fail the step.
Use the following methods to display messages during the run system.
|MessageBox VBScript function
|Displays a message that pauses the run session until the message box is closed.
|Print Utility statement
Displays messages in the Output pane during a run session.
The following code iterates all the items in the Flight Table dialog (in the sample Flight application) and uses the Print Utility statement to print the content of each item to the Output pane.
Set FlightsList = Window("Flight Reservation").Dialog("Flights Table"). WinList("From") For i = 1 to FlightsList.GetItemsCount Print FlightsList.GetItem(i - 1) Next