Specify dataset definitions

When you create a Report Definition, Tosca Commander automatically generates a Dataset Definition. The Dataset Definition displays information about the object that has been linked to the corresponding Report Definition, from which the content for the report is pulled.

A Dataset Definition can contain further Dataset Definitions. From a parent Dataset Definition, you can create multiple child Dataset Definitions on the same level. You can also create a hierarchical structure by created further forked levels within a Dataset Definition.

Dataset Definition tree structure

Create a new Dataset Definition

To create a new Dataset Definition, follow the steps below:

  1. Right-click on the Dataset Definition that should contain a further Dataset Definition.

  2. Select Create Dataset Definition from the mini toolbar.

Every Dataset Definition within a Report Definition must have a unique name. If this is not the case, the Report Definition icon will have a yellow exclamation mark: .

TQL Query

In order to generate a report for a particular object, the Dataset Definition in the Reporting section must define where this particular object can be found in your workspace tree. This is done via TQL (Tosca Query Language), which allows you to search for any object within Tosca Commander. For information on TQL grammar, see chapter "Grammar of TQL and EBNF-Notation".

To correctly specify the data that should be included in your report, you must use TQL.

You can add the TQL Query column to your Dataset Definition via the Column Chooser.

TQL Query column

To define the dataset for your report, you need to enter the relevant TQL search string into the TQL Query field. To do so, follow the steps below:

  1. Enter Ctrl + F to open the search window, and switch to the TQL Search tab.

Alternatively, you can right-click on an object and select from the mini toolbar.

  1. Use TQL Operators and Functions to search for the appropriate string.

  2. Enter the complete TQL search string into the TQL Query column.

Alternatively, instead of using the TQL Query column, you can use the Link, ObjectType, and Constraint columns to specify the TQL search.

TQL search using Link, Object type, and Constraint columns

Hierarchical display of datasets

When you create a report, the TQL search string of every Dataset Definition refers to its root element. A TQL search query that is conducted on the topmost Dataset Definition is applied to every object for which the report is generated.

If you want to display something like a TestCase containing TestSteps, you have to create a Dataset Definition for each object in the TestCase, i.e. TestCases and TestSteps. Structure your Dataset Definitions hierarchically to reflect the TestCase structure.

Hierarchical display of TestCase FolderDataset Definitions

Make sure that each Dataset Definition has a unique name. If any Dataset Definition does not have a unique name, the Report Definition icon will have a yellow exclamation mark:

Recursive Dataset Definitions

You can create recursive dataset definitions in order to display structured objects more easily. This is useful for linked objects like TestCases, Requirements, or ExecutionLists, which can have any number of nested objects within them. Instead of specifying the Dataset Definition structure a countless number of times, you can create a recursive Dataset Definition.

Define recursion

You can define a recursion by dragging and dropping a Dataset Definition onto itself or onto another Dataset Definition. To do so, follow the steps below:

  1. Select the Dataset Definition for which you want to have a recursive structure.

  2. Drag the Dataset Definition onto the Dataset Definition whose structure you want to use recursively.

Define Recursion popup menu

  1. Choose the option Define Recursion in the subsequent popup menu. The Dataset Definition icons change to indicate the recursion source and the recursion target .

In this example, you want to create a report that includes all TestCases and the following contained objects, starting from a selected TestCase or TestCase folder:

  • TestSteps

  • TestStep folders

  • TestStepValues

  • TestStepSubValues

Since TestStep folders may contain TestSteps or further TestStep folders, you want to use a recursion in this case. Using a recursive structure means that you don't have to define a Dataset Definition for each individual step.

To create your report, follow the steps below:

  1. Right-click on a Reporting folder and select Create Report Definition from the mini toolbar to create a new report.

    Create Report Definition

  2. Drag and drop a TestCase onto the Report Definition to define the Dataset Definition. Tosca automatically defines the object type of this root element as TestCase.

    Dataset Definition root element

  3. Create a Dataset Definition within this Dataset Definition by right-clicking on the existing Dataset Definition and selecting Create Dataset Definition from the mini toolbar. Assign a unique and meaningful name to the definition and select the value TestCaseItem from the Object type column. Use a TQL search to determine the correct Object type.

    You will use this Dataset Definition for your recursion later on.

    Add TestCaseItem to Dataset Definition

  4. Add further Dataset Definitions for each object type, as shown in the illustration below:

    Complete Dataset Definitions

    Make sure to change the TQL expression in the Link column to ->SELF for TestStep and TestStepFolder Dataset Definitions.

    ->SELF only transfers the selected object type without child elements, whereas ->SUBPARTS also considers all child elements.

Since all TestCase objects may exist in one TestStepFolder, the hierarchical structure can become very complex if you create Dataset Definitions for each individual object. To simplify the structure, create a recursive dataset:

  1. Select the dataset definition TestStepFolder and drag it onto the dataset definition TestCaseItem.

  2. Select Define Recursion from the popup menu.

    The Dataset Definition icons for TestCaseItem and TestStepFolder change to indicate the respective recursion target and recursion source:

    Defined recursion

In the example above, the recursive structure of the TestCaseItem Dataset Definition is repeated for further TestStepFolders, creating a kind of loop.

The recursion defined above starts with a TestCaseItem from which you want to filter out any TestSteps. These can contain TestStepValues, which can further contain TestStepSubValues. The next TestStepFolder again contains TestCaseItems from which you want to select any TestSteps as well as nested TestStepValues and TestStepSubValues.

The recursive structure of your Dataset Definition allows all TestStepFolders, TestSteps, TestStepValues, and TestStepSubValues to be included in your report.

In order to print the report, you must first create the Designer Definition. As long as the Designer Definition remains undefined, the Report Definition icon will have a yellow exclamation mark.

Default Designer Definition

Delete Recursion

You can remove a recursion by right-clicking on a recursive Dataset Definition, and selecting Clear Recursion from the context menu.

Clear Recursion

Sort Dataset Definitions

You can sort Dataset Definitions using the column Sort by in the Details tab of your workspace. If the Sort by column is not visible, add it with the Column Chooser.

Sort TestCases by Name

OmitInSequence

If you want to exclude a particular Dataset Definition from your report, set the OmitInSequence property to True.

OmitInSequence property