- Start QuickTest and
open the Recording test.
If QuickTest is not already open, choose Start > Programs > QuickTest Professional > QuickTest
Professional.
- If the Welcome window opens, click Open
Existing.
- If QuickTest opens without displaying the Welcome window, choose
File > Open or click the Open button .
In the Open Test dialog box, locate and select the Recording test, then click Open.
- Save the test as RegExpression.
Choose File > Save As. Save the test as RegExpression.
- Confirm that the Active Screen option is enabled.
If you do not see the Active Screen at the bottom of the
QuickTest window, click the Active Screen
button or choose View > Active Screen.
- Select the text for which you will create the checkpoint.
In the Keyword View, expand Welcome: Mercury: Tours and click the Select a Flight: Mercury page. The page is
displayed in the Active Screen.
In the Active Screen, scroll up and highlight the date for the
outbound flight, New York to San Francisco (12/29/2007). Right-click the highlighted string and select
Insert Text Checkpoint. The Text Checkpoint
Properties dialog box opens.
- Enter the regular expression for the text you want to check.
In the Checked Text area,
click the Constant Value Options button . The Constant Value
Options dialog box opens.
In the Value box, replace the
displayed date with [0-1][0-9]/[0-3][0-9]/200[0-9].
This instructs QuickTest to check that each character in the selected text
matches the number-range format defined by the regular expression. The
expression checks for the following format: MM/DD/200Y.
Select the Regular expression
check box. A message box prompts you to insert the backslash character before
each special character. Click No.
Note: Clicking Yes would
cause QuickTest to treat the special characters ( [ ), ( - ) and ( ] ) as literal characters and not as a regular expression.
Click OK to close the Constant
Value Options dialog box.
- Rename the checkpoint.
In the Name box, enter CheckExpectedText as the new checkpoint name.
Click OK to accept the other
default settings and close the Text Checkpoint Properties dialog box.
QuickTest adds the text checkpoint to your test. It is
displayed as a check operation on the Select a
Flight: Mercury page in the Keyword View.
- Save the test.
Choose File > Save or click
the Save button .