File Checkpoint Operation

Applies to TestComplete 14.61, last modified on April 22, 2021

Description

Use the File Checkpoint operation to compare two files with each other or to update a file that is added to the Stores | Files collection of your TestComplete project. The functioning mode of the operation is specified by the Update files setting (you can modify it in the Stores Options dialog) and by the Update attribute of the stored file. By default, the operation compares files. However, if both the Update files setting and the Update attribute are enabled, the operation will update the stored file.

The operation compares the files byte by byte and can perform the comparison in a strict manner or take into account allowed differences. For more information, see How File Verification Works.

When you add the operation to your test, TestComplete displays the Checkpoint wizard that guides you through the checkpoint creation.

Operation Result

In comparison mode, if the comparison procedure reports the files to be identical, the operation returns True and posts a checkpoint message () to the test log.

Otherwise, the operation returns False and posts an error message () and a checkpoint message to the test log. The Details panel contains the total number of differences between the Stores item and the specified file.

To obtain detailed comparison results, click the Details link that is shown in the Link column of the test log. TestComplete opens the File Comparison Result panel that shows differences between the baseline and compared files. If the operation uses a third-party Diff utility for file comparison (the utility and its launch parameters are specified by the Files diff utility options), the operation also posts an informative message to the test log. You can click the Details link in the Link column of this message to view the file comparison report generated by the utility.

For more information on this, see Analyzing File Verification Results.

In update mode the operation always returns True and posts a checkpoint message to the test log.

Scripting Analogue

The operation is analogue to the File.Check scripting method.

Note: Not all file checkpoints are analogues of the Check method. For example, the operation that compares two files that are not stored in the Files collection is converted to the Files.Compare method.

Child Operations

The operation cannot have child operations.

Operation Parameters

The operation uses the following parameters:

StoredFile

Specifies the name of the stored file that belongs to the Stores | Files collection of your project. To specify the file, use the name that the file has in this collection.

FileName

Specifies the name of the file to be compared with the stored file (an item of the Files collection). To specify the file, use the fully-qualified file name.

The order of the files is not important, if the operation performs a comparison in a strict manner, or if the operation works in update mode. However, the order of files is important if you compare the files using the AllowedDifference parameter (see below). The difference calculation algorithm takes into account which file is specified first and which file follows it. It will return a different value of dissimilarity between two files if you change the file order. So, if you compare files with the AllowedDifference parameter, you should specify them in the order in which you specified them to obtain the value of the allowed difference (see below).

AllowedDifference

Integer. Specifies the allowed difference between files in bytes. The allowed difference of physically equal files is 0. When comparing the files the operation calculates the difference between them and compares it with the AllowedDifference parameter. If the values are equal, the operation considers the files as equal.

To obtain the value of the difference between two files, you can use the string that is posted to the Details panel of the test log if comparison fails.

To modify operation parameters:

  1. Select the needed operation in your keyword test.

  2. Click the Value cell twice (not double-click) or select the cell and press F2. This will activate the in-place editor.

  3. Click the ellipsis button of the in-place editor. TestComplete will open the Operation Parameters dialog.

  4. In the dialog, specify the operation parameters. For detailed information on how to work with the dialog, see Specifying Operation Parameters.

  5. Click OK to close the dialog and apply changes.

  6. Press Enter to confirm the changes and close the in-place editor, or press Esc to close the editor discarding any changes.

To modify the value of the StoredFile parameter, click within the Operation cell and then choose the name of the desired stored element from the ensuing drop-down list.

Remarks

By default, if the File Checkpoint operation cannot find or access the file it verifies, it waits for the file for a period that the Playback > Auto-wait timeout property of your project specifies. If the file has not been found by the end of the period, the operation fails.

For information on file checkpoints and file comparison, see topics of the About File Checkpoints section.

See Also

Checkpoints Category
About File Checkpoints
Specifying Operation Parameters
Checking Operation Result

Highlight search results