Compare PDF files

The PDF Engine 3.0 allows you to compare two PDF files.

Use the Module 1:1 Compare to perform the comparison.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->PDF.

Example

The following example shows how to compare two PDF files. To do so, follow the steps below: 

  1. Import the Standard.tsu subset to your workspace (see chapter "Import and export subsets").

  2. Create a TestCase with the name Compare PDF Files.

  3. Drag and drop the Module 1:1 Compare onto the Compare PDF Files TestCase (see chapter "Creating TestSteps from Modules"). This creates a new TestStep.

  4. Define the file paths in the Value column of the XTestStepValues Reference PDF and Target PDF.

    If your files are password protected, specify the passwords in the Value column of the XTestStepValues Reference PDF Password and Target PDF Password.

  5. Define the accuracy threshold. This is the minimum required similarity between the two PDFs, expressed in percent. To do so, specify a percentage in the Value column of the XTestStepValue Accuracy [%].

  6. Optionally, specify the pages that you want to exclude from the comparison. To specify a page range, use a hyphen (-). To specify multiple pages or page ranges, use a semicolon (;).

Compare two PDF files

When you run the TestCase, Tricentis Tosca compares the two PDF files. If the percentage similarity between the two files is at or above the accuracy threshold, the TestCase passes. If the percentage similarity is lower than the threshold, the TestCase fails.