SAP specific component automation
Switching windows
In some cases, the module opens in a new SAP window. To manage this notion of window, you will have to change the window from Agilitest.
To do this, click on the window action.
.png)
Then switch to the window with index 1 (the main window is index 0).
.png)
Actions on a table
Once you have your table open in the SAP interface, open your capture tool to perform actions on it.
When capturing you will need to define a Locator, which is a set of attributes that identify the captured item.
Among the parent branches of the element you will generally find: the object (Example: "TableControl", "GridControl", "TreeControl"), the Rows, the Columns.
.png)
Several table cases are possible:
- Searching for an element of a table that appears directly on the interface
Example : A table with few lines.
When we capture an element on the screen, the search of the element with the locator will be less accurate.
The search can be done according to the "Text" attribute of the captured element and the ElementId of the "TableControl" branch.
.png)
Once the attributes are selected, drag the element into the Agilitest editor to create an action.
.png)
This type of search will not search for a row but will simply stay on the same screen.
- Searching for a table element in a long list
When you want to capture an element from a long list that requires Agilitest to browse the elements, then you must specify it with attributes.
This time you have to tell it that the element is in a "Row”
.png)
Drag the element into an action
.png)
A search in a row is done according to the text in it. Agilitest will browse the rows of the table to find the row with the text entered as an attribute.
💡 Tip
To simplify the operations it is recommended to change the text into a regular expression.
Actions on Grids
It is possible to switch a table to Grid by pressing the F8 key and specifying the number of lines you want to appear in the "Maximum number of hits" box.

With the grids it will display more information that can be read vertically and horizontally.

The capture of an element takes place in the same way as for tables, only the display of the parents of the captured elements will specify that they are grids.
.png)
Grids are a set of data organized in rows and columns.
It is also possible to search for the presence of an element in various rows using "Row".
To do this, you need to create a sub-script with runtime log comments to display the items found.
.png)
Example: If we search for the text "MIERZWA" in all rows using the text property of the "GridRow" branch, then your subscript will display the rows that include this text.
In this example, 5 iterations are displayed, so MIERZWA appears 5 times in the rows. The parameters will indicate the exact location, such as the line "1014". (see screenshot below)
.png)
With this action each row is passed to the script and each column represents a parameter.
.png)
Actions on data trees
The data tree is sometimes composed in a simple configuration with a single column that includes several levels and other times in a more complex way, with several columns in the same tree. The execution of tests on trees is similar to those on grids and tables.
The search elements of a component are similar to those of grids and tables.
.png)
The "TreeNode" branch will represent the nodes of the tree, i.e. the different levels that appear.
Each node has zero or n children that can be deployed.
.png)
Example: The "Basic Data" element has 3 children, while its children have none.
When a tree is complex, a node can have several columns.
As with grids, the tree is configured with rows that will concatenate all columns in the row.
This means that the search for elements of a tree structure is mainly done through the "Row" branch.
