To simplify creation of Excel checkpoints, TestComplete includes the Checkpoint Wizard:
1. Launch the Wizard
You can create Excel checkpoints both during test recording and when editing the test. The way you add the checkpoint to the test depends on the test creation mode:
-
Test recording –
-
Click Add Check on the Recording toolbar.
-
In the Checkpoint Wizard, select File, and then click Next.
-
-
Editing a keyword test –
-
Select the Checkpoints category in the Operations panel of the Keyword Test editor.
-
Find the Checkpoint Wizard operation in the list and drag it to your test. In the Checkpoint wizard, click File.
– or –
Find the Excel Checkpoint operation in the list and drag it to your test.
-
-
Editing a script test –
-
Open the script to be edited.
-
Click on the Code Editor toolbar:
-
In the Checkpoint Wizard, select File, and then click Next.
-
2. Specify the Excel File to Check
On the next page of the wizard, you specify the type of the file you want to verify. Click Excel to verify an Excel file (if you are configuring the Excel Checkpoint operation, the wizard will automatically select Excel comparison).
Enter the fully qualified name of your Excel file in the Specify an Excel file to check edit box or click the ellipsis button and select the file via the standard Open File dialog.
In the Options block, specify whether TestComplete will compare the entire Excel file or a specific sheet. Use the The first row is a header check box, to command TestComplete to recognize the first row of the selected sheet as the table header.
To proceed with the checkpoint creation, click Next.
TestComplete will display the next page of the wizard that depends on your chosen comparison object (an entire file or a specific sheet).
3. Specify the Expected File and the Data to Check
Comparison of an entire file
On this page, you can select a source of the baseline text content that will be used for verification:
-
To use the selected file as the baseline one, click Current file contents.
In the Save the file to Stores as a baseline copy text box, enter the name of the Stores > Files collection element that will store the baseline copy.
Note: This name will be used to address the element from tests, so it must be a valid identifier. To create a name that will match the rules of any scripting language supported by TestComplete, start it with a letter and specify only letters, digits, and underscore symbols. -
To select an existing Stores > Files item that contains the baseline text, click File from Stores. Select the needed item from the drop-down list.
Comparison of a specific sheet
On this page of the wizard, you can specify what rows and columns of the sheet will be stored and verified.
-
By default, the checkpoint will verify all rows, which the wizard retrieves from the table.
To limit the number of rows that the checkpoint will verify, select the Validate specific number of rows check box, and then enter the desired number of rows.
To verify all table rows, clear the check box.
-
Select the columns that the checkpoint will verify:
-
To mark a table column for storing and verification, select its check box in the Store column of the page.
-
To mark a table column as a Key column, select its check box in the Key column of the page. TestComplete uses the key column (or a combination of several columns) to identify rows. To provide a unique identification of table records, key column values must be different in each row. The key columns affects how the table checkpoint performs the verification (see How the Table Comparison Procedure Works).
-
In the The name of the Stores object text box, enter the name for your baseline data. This name will be used in tests to address the checkpoint.
On the Preview tab page of the wizard, you can view the data that the wizard has retrieved from the table according to the specified criteria.
Here, you can make sure that the Excel checkpoint will verify the desired data.
4. Close the Wizard
Click Finish to close the Checkpoint wizard. TestComplete will add the checkpoint statement for verifying the specified Excel file to your test.
In keyword tests
In script tests
If you are creating an Excel checkpoint while editing a test script, then the generated checkpoint code will be displayed in the Copy Text to Clipboard dialog. You will be able to copy this code to the clipboard and then paste it to the desired place in your script.