The Stores > Files collection stores files in various formats – text, PDF, XML, and others – that your tests use for comparison and verification. You can add files to this collection in several ways:
You add files to the collection as they are. TestComplete doesn’t have any specific requirements for this.
For PDF documents, it offers extended support - you can add them as binary files or as recognized text. To do the latter:
You need an active license of the Intelligent Quality add-on.
The PDF to Text plugin must be enabled in TestComplete.
If you want to add PDF files as binary documents, there are no special requirements.
During Test Recording
From TestComplete UI
If your project does not include the Stores > Files collection, add it:
Right-click the Stores > Files node in the Project Explorer and then click Add > Add File:
– or –
Open the collection, right-click anywhere in the file list and then click New Item:
Browse for the needed file in the resulting Add File dialog.
If you add a PDF file, specify whether you want to add it as a binary file or as a text file. In the latter case, TestComplete will recognize the selected file’s text contents, create a text file to store it and add the created text file to the collection. See also Creating PDF Checkpoints.
In your test, call the
For example, the code below adds the OrderList.txt file to the project’s Files collection:
if (!Files.Add("C:\\MyApplication\\OrdersList.txt", "OrdersList"))
if not Files.Add("C:\\MyApplication\\OrdersList.txt", "OrdersList"): Log.Message(Files.LastError)
If Not Files.Add("C:\MyApplication\OrdersList.txt", "OrdersList") Then
if not Files.Add('C:\MyApplication\OrdersList.txt', 'OrdersList') then
if (!Files["Add"]("C:\\MyApplication\\OrdersList.txt", "OrdersList"))
This method always adds PDF files as binary files. It does not allow recognizing and adding their text content. To add a file that you want to use as a baseline for a PDF checkpoint, create a text file that would store the expected text and add it to the collection.
When you add a file to the Files collection, TestComplete gives the added item a name based on the file name and converts it to the format that can be used in script. For example, if you add a file named 1.bat to the collection, the appropriate File item will be called A_bat, which is valid and can be used in scripts.