TreeView

TreeViews can either be shown in single-line or multiline view in Tosca TBox.

Single-line view

Tosca automatically creates single-line TreeViews when they are scanned with Tosca XScan.

These TreeViews are steered by specifying the path to the according entry. You have to use the string -> to represent path nodes.

ActionMode

Value

Description

Input

<path>

This selects the entry by using the specified path.

In this example, the engine selects the entry Level3 from the TreeView tVTreeView:

The TreeView structure looks as follows:

  • Level1
    • Level2
      • Level3

Selecting a TreeView entry by specifying the path

Multiline view

In order to display TreeViews in multiline view, you can build structured entries with Tosca XScan.

Depending on the engine used for scanning, Tosca allows you to:

  • select the TreeView and each required entry. Each entry is copied to the Module as a TreeNode.

  • select the TreeView and create entries manually in the form of ModuleAttributes (see chapter "Creating entries manually").

The following property can be verified for TreeView entries in addition to the general properties:

Property

Description

Selected

This specifies whether an entry is selected or deselected.

If multiline TreeViews are steered, the ActionMode Select must be specified for the TreeView. The ActionMode Select must also be set for all entries that are located hierarchically above the selected entry.

The table below lists all ActionModes that are available for TreeView entries. If the property is not specified in the TestStepValue, the system will use the property listed in the Default property column.

ActionMode

Value

Default property

Description

Input

x, X
<Mouse action>

Selected

This selects an entry.

A mouse action is performed on the entry.

Verify

True,
False,
<Property>

Selected

This verifies either the value or the property.

Buffer

<Buffer name>

Selected

This saves the value True if the entryis selected, otherwise False is saved.

In this example the engine selects the entry Level3 from the TreeView tVTreeView:

The TreeView structure looks as follows:

  • Level1
    • Level2
      • Level3

Selecting a TreeView entry via TreeNodes

Creating entries manually

The multiline view allow you to create entries for TreeView controls manually in the Module.

  1. In the Module, select a TreeView control to which you would like to add entries.

  2. Choose Create ModuleAttribute from the context menu of the TreeView control.

  3. Define a name for the entry to be steered.

  4. Switch to the Properties tab.

  5. Create the BusinessID parameter Name (see chapter "Identification parameters").

    Enter the name of the entry as value.

  6. Change the business type to TreeNode.

  7. Create the configuration param BusinessAssociation with the value Nodes (see chapter "Configuration Param").

  8. Create the configuration param Engine and specify the engine to be used to steer the application.

ModuleAttribute Item2-3 - TreeNode properties

Selecting entries by using relative paths

If the path to a visible entry is subject to changes, you may use relative paths in multiline view.

Please change the value of the configuration param BusinessAssociation to Descendants in the Properties tab.

The entry Item1-2 is selected as shown below, without selecting the entries that are located hierarchically above.

TreeView structure

The ModuleAttribute Item1-2 includes the configuration param BusinessAssociation with the value Descendants.

In the TestCase, set the ActionMode to Select for the TreeView tree1. The ActionMode Input selects the entry Item1-2 from the TreeView.

Selecting TreeView entries via TreeNodes

Selecting entries via indexes and names

If multiple entries of the same name exist in multiline view, you are able to use an index to define the entry to be used.

  1. Define the configuration param ExplicitName for the entry in the ModuleAttribute and set its value to True (see chapter "Configuration Param").

  2. In the TestCase use the syntax #<n> in the Name column to specify the exact entry to be used with several search results.

The second blue entry is selected via the index:

TreeView structure

In the TestCase, set the ActionMode to Select for the TreeView tree1.

The TreeView tree4 and the entries JTree and colors receive the ActionMode Select. The TestStepValue beneath the colors entry will be renamed to #2 and it will receive the value blue to search for the second entry of the value blue.

The ActionMode Verify is used with the property Selected to verify whether the currently found entry is selected.

Using the index