Comparing tables - Baseline

Tosca allows the current content of a table to be compared with the previously saved content of the same table. This generates a base file in xml format (BaseLine). In all future executions, a new file (Dump) is generated which is compared with the base file.

The engines used determine to some extent whether table comparisons are possible not. Please refer to the respective Engine Manuals for further details on table comparison.

Procedure

  1. Specify the value .BaseLine in the Value row and set the ActionMode to Verify in order to perform a table comparison.

Baseline

  1. Tosca generates the base file whenever tables are compared for the first time.

    The storage location for the file is specified in the Settings dialog under Directory. In standard installations, this is the following directory: %TRICENTIS_PROJECTS%\ToscaCommander\baselines.

    The name of this XML file is created according to the following syntax:

Syntax:

<TestCase name>_<Name of the TestStepValue><UniqueID>_<TestStep name>.xml

For test executions in the ScratchBook, the syntax is as follows:

Syntax:

<TestStep name>_<Name of the TestStepValue><UniqueID>_<TestStep name>.xml

  1. Tosca creates an XML file upon each additional execution and compares this with the base file. The storage location for the XML file is specified in the Settings dialog under Dumps. In standard installations, this is the following directory: %TRICENTIS_PROJECTS%\ToscaCommander\dump.

  1. If differences are detected upon execution, an error description is written to the execution log.

  2. If the option Require manual input is enabled in Tosca Executor, the Checklist for manual test executions will open and display the differences whenever an error occurs. You can set the test result of the TestStep either to Passed or Failed in the Checklist (see chapter "Execute manual tests").

Errors occurred upon execution - table comparison

Defining the name of the base file

In table comparisons, the name of the base file is automatically generated by default. You can also assign a user-specific name to the base file. This requires a new attribute to be created for the table control in the table's ModuleAttribute.

Procedure

  1. Select the option Create ObjectCustomControlAttribute from the context menu of the table control.

  2. Name the new attribute Baseline Filename.

  3. Enter the base file name into the TestCases section (blue) as the new attribute value.

ObjectCustomControlAttribute Baseline Filename

Displaying differences

The ViewDiffs program is part of Tricentis Tosca, and it enables you to view the differences in table comparisons. To be able to use the ViewDiffs program, the program for visualizing xml files must be defined in Tosca Viewer.

The following parameters are required for table comparison:

Extension: xml

Path: %TRICENTIS_HOME%\dll\ViewDiffs.exe

Commandline:-m "<Path to MetaSettings.xml>" -extension xml -base "<base>" -dump "<dump>"

-m "${TRICENTIS_HOME}\dll\Settings\XML\MetaSettings.xml" -extension xml -base "<base>" -dump "<dump>"

Procedure

  1. Right click on the required Execution TestStepLog in the execution log and select the option Show 'DetailViewer' from the context menu.

Option Show 'DetailViewer'

  1. Tosca Commander opens the ViewDiffs program to display the differences. The differences are highlighted red in the table:

Displaying the differences

Export Excel

The ViewDiffs program allows the table comparison results to be exported as a Microsoft® Excel file.

  1. Click on the button Export Excel.

  2. In the subsequent dialog box, select a location where the Excel file should be saved.

Modifying base files

The currently compared table content (dump) can be defined as the new base file.

Procedure

  1. Select the required Execution TestStepLog and the option Set Dump to Baseline from the context menu of the TestStep.

  2. The current Dump file is saved as the new base file.

Set Dump to Baseline

  1. The date and time when the baseline was modified are shown in the LogInfo column.