Steer Excel files

To steer Microsoft Excel files, you have to create Excel Engine 3.0 TestCases. The Standard subset contains all Modules that you need to create an Excel TestCase.

You can find these Modules under Standard modules->Engines->Excel.

For information on how to create TestSteps from Modules, see chapter "Create TestSteps from Modules".

Before testing with Microsoft Excel, make sure that the user launching Tricentis Tosca has a valid Microsoft Office license. This applies to the administrator profile as well if you plan to open it with administrator privileges.

Structure of Excel TestCases

Excel Engine 3.0 TestCases require the following base structure:

  1. Access an Excel file with the Module Open Excel Workbook.

    The Excel Engine 3.0 accesses the file in the background. It does not actually open the file on the machine.

  2. Run your Excel operation(s):

  3. Save any changes and/or close the file with the Module Close/Save Excel Workbook.

In this example, you steer data in an Excel file.

The first TestStep opens the file test.xlsx, which is located at C:\Temp\Data. You assign the name SampleWorkbook to the file.

In the second TestStep, you assign the name UserList to the data range that you want to steer. Additionally, you specify the following:

  • The data range is located in the file SampleWorkbook, specifically in the worksheet named Users.

  • The data range includes all cells from A1 to M65.

In the third TestStep, you steer the data in the data range UserList. The Excel Engine 3.0 looks for the first data row ($1) and performs the following actions:

  • Verifies whether the value of the cell in the column LastName is Kimmond.

  • Saves the value of the cell in the column ID to a Buffer named UserID.

  • Generates the current date at run-time and enters it into the cell in the column Processed.

The fourth TestStep saves and closes the file.

Manipulate data in an Excel file