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:
- HTML
- Microsoft Word
- Text
- RTF
Steps to Add File Content Checkpoint







1 |
FileContent("TestFile.docx").Check CheckPoint("TestFile.docx") |
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
- All You Need to Know about Checkpoints In UFT
- Reading and Updating MS Access Database Using ADODB in UFT
- How to Use Insight Object in UFT
- 5 Tips for Using External Environment Variables in UFT
- What are new features in the new UFT One Datatable?
- Import Excel File into Datatable in UFT
- Automation Object Model in UFT One (AOM)