Description
The File.CheckExcelWorkbook
method compares the Excel file with the baseline data. The File
object for which you call this method corresponds to an item in the Stores > Files collection of your project.
Declaration
FileObj.CheckExcelWorkbook(FileName)
FileObj | An expression, variable or parameter that specifies a reference to a File object | |||
FileName | [in] | Required | String | |
Result | Boolean |
Applies To
The method is applied to the following object:
Parameters
The method has the following parameter:
FileName
Specifies the fully-qualified name of the Excel file to be used for comparison.
Result Value
If the method determines the files are equal, it returns True and posts a successful message () to the test log.
Otherwise, the method returns False and posts an error message (). It also posts the "checkpoint failed" message and a detailed comparison report.
Remarks
This operation compares entire Excel files only, to compare a specific sheet, use the Table.Check method.
Example
The following example shows how you can compare the content of an actual Excel file and the contents of the Stores > Files item.
Note: | In order for the code to run successfully, your project must have the Stores > Files collection. |
JavaScript, JScript
Files.DataStorageExcel1.CheckExcelWorkbook("C:\\Temp\\DataStorageExcel.xlsx");
Python
Files.DataStorageExcel1.CheckExcelWorkbook("C:\\Temp\\DataStorageExcel.xlsx")
VBScript
Call Files.DataStorageExcel1.CheckExcelWorkbook("C:\Temp\DataStorageExcel.xlsx")
DelphiScript
Files.DataStorageExcel1.CheckExcelWorkbook('C:\Temp\DataStorageExcel.xlsx');
C++Script, C#Script
Files["DataStorageExcel1"]["CheckExcelWorkbook"]("C:\\Temp\\DataStorageExcel.xlsx");
See Also
Validating Data in Excel Files
Working with Microsoft Excel Files
Compare Method