File Content Checkpoint | PDF File Validation in UFT

The file content checkpoint is used to compare the textual content of a file that is generated during a run session with the textual content of a source file. This enables you to verify that the generated file contains the expected values. In UFT it is mainly used to validate the content of a PDF File.

You can perform the following kind of verification

  • Validate text string in one line only
  • Validate text string in multiple lines
  • Validate the entire document

You can also ignore certain lines of texts in the file if it is supposed to change.

When you select a source document to compare, UFT converts a copy of this document to a text file and displays the content in the file content editor area of the Checkpoint Properties Dialog Box enabling you to configure your checkpoint. You can use parameters and regular expressions to augment your checkpoint, as needed.

You can perform a file content checkpoint for any of the following file types:

  1. HTML
  2. Microsoft Word
  3. Text
  4. PDF
  5. RTF

Steps to Add File Content Checkpoint

To add a File Content Checkpoint, select the File Content Checkpoint option from the recording session wizard.
File Content Checkpoint in UFT
UFT will give an option to browse the required file. Select the required file and click on the “Open” button.
You have to select the highlighted checkbox as shown below to select all lines of the required file to be validated at runtime. If you want to skip a line, uncheck the checkbox against that line.
You have to select the highlighted checkbox as shown below to select all lines of the required file to be validated at runtime. If you want to skip a line, uncheck the checkbox against that line.
You can also parametrize a line of the file. Select the required text string of a line and click on the parameter <p> icon.
The Value Configuration Options window will be displayed. Select the Parameter radio button. Provide the name of the parameter.UFT will automatically add a column with the parameter name in the Datatable. You can also provide the Sheet name where the parameter needs to be added. By default, the Global sheet will be selected.
Click on the “OK” button. The parameter will be added in the UFT DataTable and the required text string will be replaced with the UFT DataTable parameter command that retrieves the value from DataTable.
Click on the “OK” button. The File Content Checkpoint will be added to your Test.

Also, the parameter will be displayed in the DataTable.


You can also add a regular expression in the File Content Checkpoint. Move the mouse pointer on the required line and click on the regular expression icon. If there are any special characters in the line UFT will display a message to add a backslash before every special character. Click on the “No” button and manually add the backslash(\) in the regular expression.


Select the few characters of the line. UFT will automatically show a small icon window. Click on the highlighted as shown below. It will open the Regular Expression Evaluator window where you can write your regular expression as well as evaluate it.


Once you have checked that your regular expression has matched with the Sample text. Click on the “OK” button.


The line of text will be replaced with regular expression.


That’s it. Now enjoy 🙂

Recommended Posts

Leave a Reply