SAP I TableTree
The Module SAP TableTree is used for steering table trees.
You can steer SAP TableTrees with SAP Engine 3.0. For detailed information, see chapter "SAP TableTree". |
Unlike TreeViews, TableTrees contain a tree in the first column and tables in the second column. Therefore, the Module SAP TableTree contains the attributes Row, Columns and Action.
SAP TableTree
Steering of SAP TableTrees
Creating TableTrees
You can add any number of new TableTrees to the Module SAP TableTree.
-
Select the ModuleAttribute TreeView in the Module SAP TableTree.
-
Select the option Create ControlGroupItem from the context menu of the attribute.
Create TableTree
A name and a TechnicalID must be entered for the new TableTree. The TechnicalID is determined using Tosca Wizard.
-
Scan the required window using Tosca Wizard. The technical ID is displayed in Tosca Wizard in the SAP ID field of the required TableTree.
TechnicalID in Tosca Wizard
-
Copy the value of the SAP ID of the TableTree to the clipboard.
-
Close Tosca Wizard. The Module is not saved.
-
Select the ModuleAttribute TreeView in the left window section of Tosca Commander™.
-
Switch to the right section of the window, go to the Properties tab and select the newly created TableTree.
-
Copy the value of the property SAP ID to the Value column of the property TechnicalId.
TechnicalId of the new TableTree
Defining TestSteps
-
Select the TableTree to be steered from the drop-down menu in the Value field of the TestStepValue TreeView.
Selecting the required TreeView
-
In the TestStepValue Row, define the path to the required node (see chapter "SAP I TreeView").
-
Specify the required input action in the TestStepValue Action.
The following input actions are possible for elements that are embedded in a TableTree:
Syntax |
Description |
click, dblclick, linkclick |
Click with the left mouse button, double-click with the left mouse button or click on a link. The system clicks using the SAP Engine methods. |
{click}, {dblclick}, {rightclick} |
Click with the left mouse button, double-click with the left mouse button or click with the right mouse button. These clicks are generically performed by calculation of coordinates using the mouse pointer or simulated key entries. |
drag, drop |
A drag or drop operation on an item in the TableTree. |
select |
Selects an item in the TableTree. |
x, [space] |
Selects or deselects an item in the TableTree. |
-
Define the column to be steered via the TestStepValue Column, if needed.
In the following example the node Workflow->Prüfung is selected. The link in the row with the column 5 containing the value Kandidat is clicked on.
Example - linkclick with row selection |
In the next example a cell or the clickable element in column 2 of the node Prozess->Tester is clicked on.
Example - click with column and row selection |
Verifying ChildNodes
It is possible to verify how many ChildNodes a node contains. Thus under Row the path to the desired node is specified. Under Action .childCount=n is entered and the ActionMode is set to Verify.
Verification of ChildNodes
Verifying the existence of a node
The existence of nodes is verified by entering the following syntax into the Action row: .itemexists=True oder False.
The path to the required node is to be specified under Row. At least one row must be specified.
The ActionMode must be set to Verify.
Verify existence of a node
Legacy steering
With legacy steering, the desired node can additionally be verified by specifying the column number and the content of the table of the tree. For this purpose, the following syntax must be used:
Syntax: |
<Level1>-><Level2>->...<Level x>;<column no.>=<value>;<column no.>=<value> |
This syntax can be used for all hierarchy levels.
In the first column of a TableTree the node hierarchy is displayed.
a->b->c;3=Test1;4=Test2 In this example, c is assumed as the value of the first column. Test1 must be found in column 3, and Test2 in column 4. |
Verifying the traffic light value of a node
Nodes of TableTrees may receive a traffic light value that can be verified. For this purpose, under Row, the path to the desired element is specified, in the row Action, the ActionMode is set to Verify and under Value, the color (Green, Yellow, Red) is specified.
This entry is case sensitive! Under Column Trafficlight must be entered.
Verify traffic light value
Verifying the IconName of a node
TableTrees may contain icons with names which can be verified. Under Row, the path to the desired symbol is specified, in the row Action, the ActionMode is set to Verify, and under Value, the name of the icon is specified. Under Column, the IconName must be entered.
Verify IconName
The verification of IconNames is only supported for emulated Trees.
Verifying icons with screenshot comparison
If icons are contained in TableTrees, they can be compared within a reference folder. These reference images must be provided in BMP format. A screenshot of the icon is created in the TableTree for comparison. The comparison returns the name of the image contained in the reference folder without an extension and that differs from the screenshot to the lowest extent. The settings that are relevant to this verify process, such as the path to the reference folder, are specified in the Settings dialog under Special Engines->SAPEngine->IconCompare (
The images used for comparison purposes should
-
be almost of the same size as the icon to be verified
-
have a light background color
-
only include the images which have had TestSteps executed for them.
In this example, the engine verifies whether the icon in row Level1->Level2 and column Icon of the TableTree TableTree1 matches the reference image Image1.
Verify icon via screenshot comparison |
Emulated Trees
Emulated Trees are containers of labels. They consist of individual control elements and are steered with the Module SAP TableTree.
Example Emulated Tree
Steering headers
SAP TableTrees are identified by the control names. As the text of the header may vary from language to language, but the column names remain the same and are independent from the applied language, the
For this purpose, the parameter IdentifyColumnBy must be created in the ObjectMap of the SAP TableTree Module (please note that the parameter is case sensitive).
Parameter IdentifyColumnBy
The following values can be specified for the parameter IdentifyColumnBy:
-
text: the SAP TableTree header is steered via the header text
-
name: Die SAP TableTree header is steered via the header name
If no value is specified or if the parameter IdentifyColumnBy does not exist, the default value text is applied.
Using templates
If a certain sequence of Actions should be applied to every node in a TableTree, this sequence can be saved to an Excel template and reused.
Procedure
-
The Action row indicates in which Excel file the values should be read.
Syntax: dumpChildren[<Path to Excel® file>\<Name of worksheet>]]
Example: dumpChildren[C:\Temp\children.xls\Table1]
-
The row indicates the node from which the child elements are to be written to the Excel sheet.
-
In addition, the TestCase name, the name of the parent node and the table tree name are also copied to the Excel sheet.
Example dumpChildren in the TestCase
Example dumChildren in Excel
Using wildcards and regular expressions in paths
Wildcards and regular expressions can be used when specifying paths in the TestStepValue Row. Additionally, entering an index is an option. The index is specified after the wildcard or the regular expression in square brackets: [Index].
For regular expressions, the following syntax is used:
Syntax: |
{REGEX[<regular expression]} |
The root node Workbench Demos is searched for. Then the first child node is selected, and from this the fifth child node, and then from this the third child node. Workbench Demos->*[1]->*[5]->*[3] |
The first child node is selected, starting from the root node. From this, the fifth child node which contains the string Control in its name is selected, and then from this the third child node. ->*[1]->{RegEx[.*Control.*]}[5]->*[3] |