Steer SAP controls

With the SAP Engine 3.0, you can steer controls in SAP.

The table below lists all SAP controls that you can steer.

Name of SAP controls

Identified in XScan as

Standard Module

Button

Button

Check Box

CheckBox

Calendar, Text Box

TextBox

ComboBox

ComboBox

ContextMenu

SAP ContextMenu

Emulated Tree

SAP Emulated Tree

Emulated Table Tree

SAP Emulated Table Tree

Label

Label

Login

SAP Login

Logon

SAP Logon

Menu

SAP Menu

Multiple Logon

SAP Multiple Logon License Warning

Radio Button

RadioButton

SpecialToolbar

TreeView

StatusBar

SAP Statusbar

SubToolbar

SAP SubToolbar

Table

Table

TableTree

TableTree

Toolbar

SAP Toolbar

TreeView

TreeView

SAP TreeView

SAP Calendar

The SAP Calendar control allows you to select a date, range of dates, or a week from the SAP Calendar. You can scan the SAP calendar control with XScan.

SAP calendar control

To scan and steer this control, follow the steps below:

  1. Scan the calendar control with XScan.

  2. Create a TestCase with the scanned Module.

  3. Set the ActionMode of the calendar control to Input.

SAP Calendar Module in a TestCase

  1. In the Value field, insert the correct date format as described in the table below.

Date format

Description

Example

yyyyMMdd

Enter the year, the month, and the day to select a specific day in the calendar.

20190430

yyyyMMdd-yyyyMMdd

Enter the start date and end date to select a range of dates in the calendar.

20190401-20190430

CWxx/yyyy

Enter CW followed by the week number and the year to select a specific week in the calendar.

CW12/2019

SAP ComboBox

The ComboBox control allows you to select an item from a predefined drop-down list. A ComboBox item is an entry in the drop-down list. You can steer ComboBoxes as described in chapter "ComboBox".

In SAP, every ComboBox item has a key and a value:

  • A key can consists of letters and numbers.

  • A value is the text of the item.

Values in a ComboBox

By default, SAP GUI displays only values. However, you can enable displaying both keys and values.

Alternatively, you can enable Tricentis Tosca to identify ComboBox items by both keys and values.

Keys and values in a ComboBox

Display keys in SAP

To display keys in SAP GUI, follow the steps below:

  1. In SAP GUI, click the Customize Local Layout icon and select Options... from the context menu.

Customize Local Layout context menu

  1. In the Options screen, go to Interactive Design->Visualization 1->Controls.

  2. In the Controls area, select the check box Show keys within dropdown lists.

Show keys within dropdown list check box in SAP GUI

Enable Tricentis Tosca to identify ComboBox items by keys and values

When you scan an SAP ComboBox, Tricentis Tosca identifies ComboBox items by their values by default. ComboBox items can share the same value, which makes it impossible to uniquely identify the values. You can make ComboBox items identifiable by both keys and values in Tosca Commander. This setting works regardless of whether keys are displayed in SAP GUI or not.

To identify ComboBox by both keys and values, follow the steps below:

  1. In Tosca Commander, go to Projects->Settings.

  2. In Tosca Settings, go to Settings->TBox->Engines->SAP.

  3. Click the Combobox items selectable by its Key row.

  4. Select True from the drop-down list in the Value column.

Enable Tricentis Tosca to identify ComboBoxes by both keys and values

When you scan a ComboBox, Tricentis Tosca now shows items in TestCases with both keys and values.

Keys and values in the Value field

If you enable this option in Tosca Commander and create Modules with ComboBoxes, the TestCases which use these Modules only work properly if this option remains enabled. If you disable it, you need to rescan the Modules.

However, changing this setting in SAP doesn't influence Modules in Tricentis Tosca.

SAP ContextMenu

To steer SAP context menus, use the Module SAP ContextMenu.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

SAP context menu

Context menus must be open for the SAP Engine 3.0 to steer them. Use image-based test automation to open context menus in trees.

In this example, the SAP Engine 3.0 opens the context menu and selects the entry Insert Unicode control character->Zero width joiner.

SAP context menu: specify the menu path

In this example, the SAP Engine 3.0 opens the context menu and verifies whether the option Zero width joiner exists.

Verify SAP context menu entries

SAP Emulated Tree

To steer SAP Emulated Tree, use the Module SAP Emulated Tree.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

In this example, you want to click on the entry BAPISDBUSI in the following Emulated Tree:

Emulated Table Tree in SAP

To do so, you use the Module SAP Emulated Tree and enter the following TestStepValues:

  • For the ModuleAttribute Tree, you enter the path to the entry using nodes ->. Tricentis Tosca finds several entries that match this path, so it selects the first one.

  • For the ModuleAttribute Column, you enter #3, because the empty space after the first column is also recognized as a column.

  • For the ModuleAttribute Action, you enter {CLICK} to click on the entry.

  • You don't change the default ScanAlgorithm ModuleAttribute.

SAP Emulated Tree Module in a TestCase

In this example, you want to verify if the traffic light in Other Objects is set to Red.

Emulated Tree in SAP

To do so, you use the Module SAP Emulated Tree and enter the following TestStepValues:

  • For the ModuleAttribute Tree, you enter the path to the entry using nodes ->.

  • For the ModuleAttribute Column, you enter #1, because the traffic light is in the first column.

  • For the ModuleAttribute Action, you enter Red, because you want to check if the Value of the traffic light is Red. You set the ActionMode to Verify.

  • You don't change the default ScanAlgorithm ModuleAttribute.

SAP Emulated Tree Module in a TestCase

SAP Emulated Table Tree

To steer SAP Emulated Table Tree, use the Module SAP Emulated Table Tree.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

Emulated Table Tree in SAP

SAP Emulated Table Tree consists of the following elements:

  • The main table with expandable rows. The header with column names of this table is at the top. Each corresponding row is marked with the icon Detail can be Expanded. In SAP, both the header and the rows of the main table are marked with an orange color. In the Module SAP Emulated Table Tree, it's represented by Header Table.

  • The embedded table. The header with column names of this table is under the header of the main table. In SAP, it's marked with a blue color. The content of this table is visible when you expand the rows of the main table. In SAP, the content area of the embedded table is white. In the Module SAP Emulated Table Tree, it's represented by Content Table.

In this example, you want to verify if the value of the cell marked on the following screenshot is 591,48:

Emulated Table Tree in SAP

To do so, you use the Module SAP Emulated Table Tree and enter the following TestStepValues:

  • To steer the main table, you enter the row number $1. This selects the first row of the main table.

  • Under the Content Table, you enter the row number $4 to select the first row of the embedded table.

  • In <Cell>, you enter the name of the column Val/COArea Crcy, because it contains the cell you want to verify. You can also use the cell number, in this case $15 (empty cells and spaces between columns are also counted).

  • In the Value field of this cell, you enter 2.957,40 to verify if it contains this value.

  • In the ScanAlgorithm ModuleAttribute, you leave the default value FastVerticalFastHorizontalWithStaticArea, because this Emulated Table Tree contains frozen top rows.

SAP Emulated Table Tree Module in a TestCase

In this example, you want to verify the following values in an Emulated Table Tree:

Emulated Table Tree in SAP

To do so, you use the Module SAP Emulated Table Tree and enter the following TestStepValues:

  • In <Cell>, you enter the value of the first cell in a row that you want to steer. You set the ActionMode to Constraint. SAP Engine 3.0 searches for the row that contains the cell with the value you specified and restricts test automation to this row.

  • You specify the name of another cell by its column Doc. Date. You enter the value 31.03.2020 to verify if it contains this value.

  • Under the Content Table, you enter the row number $1, because you want to verify the content of a cell in the first row of the embedded table.

  • In <Cell>, you enter the name of the column Val/COArea Crcy, because it contains the cell you want to verify. You can also use the cell number, in this case $15 (empty cells and spaces between columns are also counted).

  • In the Value field of this cell, you enter 2.957,40 to verify if it contains this value.

  • In the ScanAlgorithm ModuleAttribute, you leave the default value FastVerticalFastHorizontalWithStaticArea, because this Emulated Table Tree contains frozen top rows.

SAP Emulated Table Tree Module in a TestCase

SAP Login

To enter user data into the SAP Login screen, use the Module SAP Login.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

To sign in to SAP with the Module SAP Login, follow the steps below:

  1. Launch the SAP system with the Module SAP Logon.

    This step is a mandatory first step if you want to steer the SAP Login screen.

  2. Create a new TestStep out of the Module SAP Login to enter the required user data.

In this example, you sign in to Client 001 with the user credentials of the user test01.

  • The first TestStep uses the SAP Logon Module to open the SAP system.

  • The second TestStep steers the Login screen. The SAP Engine 3.0 enters the necessary data and confirms with Enter.

Open the SAP system, then steer the Login screen

SAP Logon

To steer the SAP Logon window, use the Module SAP Logon.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

SAP Logon screen with the SID column

In this example, you open the SAP Logon dialog using the connection name.

Open an SAP connection using the connection name

In this example, you open the SAP Logon dialog using the SID.

Open an SAP connection using the SID

SAP Menu

To steer SAP menus, use the Module SAP Menu.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

In this example, you select the menu entry QuickViewer by entering the path System->Services->QuickViewer.

SAP menu: use the menu path

In this example, you directly select the menu entry QuickViewer.

SAP menu: use the menu entry directly

In this example, the SAP Engine 3.0 verifies that the menu entry System->Services->QuickViewer exists.

SAP menu: verify that the menu entry QuickViewer exists

SAP Multiple Logon

To steer the modal dialog window License Information for Multiple Logon, use the Module SAP Multiple Logon License Warning.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

The modal dialog box License Information for Multiple Logon opens if a user attempts to sign in to the system several times.

You can define the caption of the dialog box in the Properties tab of the Module. To do so, enter the respective Value for the parameter CaptionList. To enter the caption in multiple languages, separate them with semicolons.

In this example, the SAP Engine 3.0 performs the following actions:

  • It continues with the current log-on attempt and terminates any other log-on attempts.

  • It confirms the selection and closes the dialog box.

Steer the License Information for Multiple Logon dialog box

SAP SpecialToolbar

SAP SpecialToolbar is a toolbar with buttons that open context menus.

Context menu of the Total toolbar button

Follow the instructions in this chapter to:

Scan SAP SpecialToolbar

To scan SAP SpecialToolbar, follow the steps below:

  1. Run XScan and select the SAP window you want to scan.

  2. If you use the Basic View or the Condensed View in XScan, right-click the table grid and select Toolbar from the context menu. This enables you to scan a toolbar independently from its table grid.

    If you use the Advanced View in XScan, you must enable the Select on screen option first.

Select on Screen context menu options

  1. Save the Module or continue to scan other screens as described in chapter "Select controls in the test object".

Steer SAP SpecialToolbar

To steer SAP SpecialToolbar, follow the steps below:

  1. Scan the SAP SpecialToolbar with XScan.

  2. Create a TestCase with the scanned module.

  3. In the Value field of the Toolbar control, select the context menu item you want to steer.

Toolbar control in the TestStep

  1. Set the ActionMode to Input.

SAP Status Bar

To verify information on the SAP Status Bar as well as various session information, use the Module SAP Statusbar.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

SAP Status Bar

In this example, you verify whether the type of the status bar message is Success.

Verify SAP Status Bar - MessageType

Scan SAP Status Bars

You can scan the SAP Status Bar with Tosca XScan. For detailed information on scanning Modules with Tosca XScan, see chapter "Scan Modules".

You can verify the following properties via the Value column: 

Property

Description

Message

Verifies the text of the status bar message.

MessageType

Verifies the type of the status bar message.

You can use the following values:

  • Success

  • Warning

  • Error

  • Abort

  • Information

In this example, you use the property Message to verify whether the text of the status bar message is Transaction.

Verify SAP Status Bar - Message

SAP SubToolbar

To steer SAP SubToolbars, use the Module SAP SubToolbar.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

Alternatively, you can also scan SAP SubToolBars with XScan.

SAP SubToolbar

Define the tooltip text of the SubToolbar button you want to click via the parameter SubToolBar.

If a tool-tip text of a SubToolbar button contains nodes ->, Tricentis Tosca recognizes it as an entry path. To change this behavior, you can use wildcard characters *.

Label that contains nodes

Wildcard characters in SAP SubToolBar TestStep

In this example, the SAP Engine 3.0 steers the Create role button in the SAP SubToolbar.

Steer an SAP SubToolbar

SAP Table

You can scan SAP tables and SAP grid views with XScan, and steer them as described in chapter "Table".

If one control is defined in a cell, you can steer it. If more than one control is defined, you can embed the controls in the cell of a table. For detailed information on defining controls in cells, see chapter "Defining controls in cells".

SAP Table

Tricentis Tosca supports the following click operations along with the ActionMode Input:

Click operation

Description

{SELECT}

Selects the specified row, column, or table.

{ADDSELECT}

Selects the specified row or column while any existing selections remain unchanged.

{DESELECT}

Deselects the specified row or column while any existing selections remain unchanged.

In the example below, you select the second row of the Project Overview table.

Select a table row

Tricentis Tosca supports the selection of a whole SAP table or grid view, when the SAP Toolbar provides the function Select All.

SAP Table Toolbar: Select All

In the example below, you select the whole table Content Repository.

Select the whole table

Verify the traffic light value of a node

Tables may include a traffic light status that you can verify with the ActionMode Verify. To do so, follow the steps below:

  1. Create a TrafficLight control in the Module as described in chapter "Defining controls in cells".

  2. Select the traffic light color to be verified in the corresponding TestStepValue.

    The following values are possible: Green, Yellow, Red.

  3. Set the ActionMode to Verify.

In this example, you verify whether the traffic light value of the first data row is Green.

Traffic light status in SAP

Verify the traffic light status

SAP TableTree

You can scan SAP TableTrees with XScan.

SAP TableTree

You can steer the respective entries in the following ways:

  • Specify a path.

  • Select the items directly via the tree items.

To steer the table tree, set the ActionMode to Select for the TableTree control. If you enter the path, separate the nodes with ->. If you select the items directly, you must use the ActionMode Select for all items that are located hierarchically above the selected item.

To select the cell of a TableTree item, enter the name of its column into the Name column.

To steer controls within cells, you have to create embedded controls (see chapter "Defining controls in cells").

In the example below, Tricentis Tosca selects the entry Workbench Demos->Controls->Picture Controls->Screen display and buffers the value of the cell in the column Report/Transaction into the buffer ColumnName.

Buffer a TableTree entry

Buffer a TableTree entry via the path

In some transactions, for example WE02 and WE05, the TableTree contains underlying nodes, which are additional nodes inside a TableTree node.

TableTree with underlying nodes in SAP

In this example, you want to steer an element of a TableTree that contains underlying nodes. To do so, follow the steps below:

  1. To specify the main node of the TableTree, enter the name of each TableTree Folder element into the Value field. Set the ActionMode to Select.

  2. To select the underlying node, enter the column name into the name of the Cell, for example IDoc display. In the Value field of the Cell, enter the name of this node. Set the ActionMode to Constraint.

  3. Replace TableTreeNode with # and the number of the row containing the element that you want to steer or verify. Set the ActionMode to Select.

  4. To click the element in this row, enter the column name into the name of the Cell, for example, IDoc display. In the Value field of the Cell, enter the name of the element that you want to steer, for example E101BA*. Set the ActionMode to Constraint.

  5. Create another Cell with the same name and enter {CLICK} into the Value field. Set the ActionMode to Input.

Steer TableTree with underlying nodes

When you use the ActionMode Constraint on a TableTree, Tricentis recommends that you use the $ sign to define a parameter such as a ColumnName or ColumnNumber.

If you use the # sign, Tricentis Tosca only returns the occurrence which matches the ordinal number specified.

For instance, #3 returns only the third occurrence of cells containing this parameter. $3 returns the first, second and third occurrences of cells that contain the parameter.

Copy cell paths from Content View in XScan

You can copy cell paths for SAP TableTrees to simplify the creation of TestCases. To do so, follow the steps below:

  1. Scan the TableTree with XScan.

SAP TableTree

You can now view the cell path of the TableTree in Content View.

Copy inline path to clipboard option in Content View

  1. In Content View, click on Copy inline path to clipboard.

  2. In the subsequent dialog window, click OK.

Notification message in XScan

  1. Paste the cell path into your TestStep.

Cell path in a TestStep

Verify the traffic light value of a node

SAP TableTrees may include a traffic light status that you can verify with the ActionMode Verify. To do so, follow the steps below:

  1. Create a TrafficLight control in the Module as described in chapter "Defining controls in cells".

  2. Select the traffic light color to be verified in the corresponding TestStepValue.

    The following values are possible: Green, Yellow, Red.

  3. Set the ActionMode to Verify.

Identify columns by the name

You can identify a column of a TableTree via its name instead of its caption. To do so, use the steering parameter IdentifyColumnsByName

The steering parameter is created when you scan the control. You can edit it via the XScan Identify By Properties grid in the Steering section. 

To steer columns by their name instead of their caption, you must set the steering parameter to True.

SAP Toolbar

To steer an SAP Toolbar that contains the transaction code field, use the Module SAP Toolbar.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

SAP Toolbar with transaction code field

You can also scan and steer SAP Toolbars that contain context menus. To do so, follow the steps described in chapter "SAP SpecialToolbar".

In this example, you search for transaction code RZ11.

Search for a transaction code

SAP TreeView

To steer SAP TreeViews, use the Module SAP TreeView.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Sap.

You can also scan SAP TreeViews with Tosca XScan.

SAP TreeView

In this example, the SAP Engine 3.0 opens the menu entry SDCCN - Service Data Control Center via double-click.

Steer SAP TreeView