Creating PDF Checkpoints

Applies to TestComplete 15.68, last modified on October 03, 2024

To simplify creation of PDF checkpoints, TestComplete includes the Checkpoint Wizard:

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 –

    1. Click Add Check on the Recording toolbar.

    2. In the Checkpoint Wizard, select File, and then click Next.

      PDF Checkpoint: Selecting checkpoint type

      Click the image to enlarge it.

  • If you are editing a keyword test –

    1. Select the Checkpoints category in the Operations panel of the Keyword Test editor.

    2. 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.

      PDF Checkpoint: Adding PDF checkpoints to keyword tests
  • If you are editing a script –

    1. Open the script to be edited.

    2. Click on the Code Editor toolbar:

      Adding checkpoints to script tests
    3. 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.

PDF Checkpoint: Specifying a PDF file to check

Click the image to enlarge it.

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:

PDF Checkpoint: Specifying baseline data

Click the image to enlarge it.

  • 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.

See Also

PDF Checkpoints
Verifying Files With Variable Parts

Highlight search results