To simplify creation of PDF checkpoints, TestComplete includes the Checkpoint Wizard:
2. Specifying the PDF File to Check
3. Specifying the Expected File
1. Launching the Wizard
You can create PDF checkpoints both during test recording and when editing the test. The way you launch the wizard depends on the test creation mode:
-
If you are recording a test –
-
Click Add Check on the Recording toolbar:
-
In the Checkpoint Wizard, select File, and then click Next.
-
-
If you are editing a keyword test –
-
Select the Checkpoints category in the Operations panel of the Keyword Test editor.
-
Find the Checkpoint Wizard operation in the list and drag it to your test. In the Checkpoint wizard, click File.
– or –
Find the PDF Checkpoint operation in the list and drag it to your test.
-
-
If you are editing a script –
-
Open the script to be edited.
-
Click on the Code Editor toolbar:
-
In the Checkpoint Wizard, select File, and then click Next.
-
2. Specifying the PDF File to Check
On the next page of the wizard, you specify the type of the file you want to verify. Click PDF to verify a PDF file. (If you are configuring the PDF Checkpoint operation, the wizard will automatically select PDF comparison.)
Enter the fully-qualified name of your PDF file in the Specify the file to check edit box or click the ellipsis button and select the file via the standard Open File dialog.
To proceed with the checkpoint creation, click Next.
3. Specifying the Expected File
On the next page, you can select a source of the baseline text content that will be used for verification:
-
To use the selected file as the baseline one, click Current file contents.
In the Save the file to Stores as a baseline copy text box, enter the name of the Stores > Files collection element that will store the baseline copy.
Note: This name will be used to address the element from tests, so it must be a valid identifier. To create a name that will match the rules of any scripting language supported by TestComplete, start it with a letter and specify only letters, digits, and underscore symbols. -
To select an existing Stores > Files item that contains the baseline text, click File from Stores. Select the needed item from the drop-down list.
4. Specifying Checkpoint Options
Specify the Allowed difference parameter. It indicates the allowed difference between the compared and baseline texts (in bytes). This may be needed when the texts are identical logically but differ physically. For instance, you can compare two lists of customers that contain the same data but have different formatting.
The comparison procedure calculates the value of the actual difference between the compared files and checks the actual value with the value specified in the Allowed difference edit box. If the values are the same, TestComplete considers the files identical. See Comparing Files by Bytes for details.
5. Closing the Wizard
Click Finish to close the Checkpoint wizard. TestComplete will add the checkpoint statement for verifying the specified PDF file to your test.
If you are creating a PDF checkpoint while editing a test script, then the generated checkpoint code will be displayed in the Copy Text to Clipboard dialog. You will be able to copy this code to the clipboard and then paste it to the desired place in your script.