Handling Application Messages
This section discusses how to handle application messages.
Use the Message Recognition feature to specify how PTF will respond to messages, such as warning messages or error messages, issued by the application being tested.
For example, suppose you have the following manual test instructions:
12. Clear the Calculate all Plans checkbox. If you get the following warning, click OK: Warning - Remember all plans must be selected to ensure an accurate 415 limit calculation (48,17)
When you record the test, the step that triggers the message and the step that clicks OK might look like this:
However, some test cases belonging to this test might not deselect the Calculate all Plans check box in the first step. In these cases, the first step would not trigger the warning message and PTF would fail to find the OK button in the second step.
You could use conditional logic to evaluate whether the test case deselects the check box. Alternatively, you could use the Error Handling feature to indicate that PTF should click OK whenever that specific message appears in the application.
To create a message definition, access the Message Recognition dialog box.
With a test open, click the Message Recognition icon.
Enter the text of the message, or a portion of the text, in the Message field.
The following example uses the message catalog number rather than the full message text.
You can define message definitions at either the test or test case level. Message definitions defined at the test case level take precedence over message definitions defined at the test level.
Select which button the step should click.
Specify what action PTF should take after the button is clicked.
To delete a message, select the message line and press the Delete key.
This example shows the Message Recognition dialog box. In this example when the application message (1040,3) error occurs, PTF will click the Cancel button and abort the test execution.
Note: Test case message definitions take precedence over test message definitions.
This table lists the names and definitions of the elements on the Message Recognition dialog box:
Field or Control
Enter the message, or portion of the message, displayed by the error. For example, you might use the Message Catalog numbers.
Enter the button that PTF should click when it encounters the message.
Valid values are:
Select the action that PTF will take.
Valid actions are: