SAP Modules

The folder TBox XEngines->Sap in the Standard subset contains Modules that perform specific tasks for the SAP Engine 3.0.

The Sap folder contains a sub-folder named Classes with additional Modules ContextMenuEntry, MenuEntry, and TreeMenuEntry. These Modules perform background tasks for Modules that you use for your tests. You can't use them in TestCases.

SAP ContextMenu

The Module SAP ContextMenu allows you to steer SAP context menus.

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.

The Module has the following ModuleAttributes:

ModuleAttribute

Description

ContextMenu

Path to the menu item.

Indicate nodes with ->, for instance Insert->Image.

Use x, X, or no value to select the entry directly.

ContextMenu->ContextMenuEntry

Alternatively, you can use ContextMenuEntry to specify the menu item (see the example below).

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 Login

The Module SAP Login allows you to steer the SAP Login screen.

It has the following ModuleAttributes:

ModuleAttribute

Description

Client

Client you want to use.

User

User name of the user that should sign in.

Password

Password of the user.

Language

Preferred language.

Enter

Enter {Click} to perform a mouse click on the Enter button.

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

The Module SAP Logon allows you to open an SAP session, i.e. to steer the SAP Logon window.

This is a mandatory first step if you want to steer the SAP log-in screen.

It has the following ModuleAttributes:

ModuleAttribute

Description

SapLogonPath

Full path to the program file saplogon.exe.

SapConnection

Name or system ID (SID) of the session that you want to connect to.

You can use wildcards.

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

The Module SAP Menu allows you to steer SAP menus. You can also verify whether a certain menu entry exists by using ActionMode Verify.

It has the following ModuleAttributes:

ModuleAttribute

Description

MenuBar

Path to the menu item.

Indicate nodes with ->, for instance Insert->Image.

Use x, X, or no value to select the entry directly.

MenuBar->MenuEntry

Alternatively, you can use MenuEntry to specify the menu item (see the example below).

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 License Warning

The Module SAP Multiple Logon License Warning allows you to steer the modal dialog window License Information for Multiple Logon.

This dialog opens when a user attempts to sign in to the system several times.

The Module has the following ModuleAttributes:

ModuleAttribute

Description

Login Options

Specify what to do with the attempts to sign in.

The following values are available:

  • Continue with this logon and end any other logons in system: the SAP Engine 3.0 continues with the current log-on attempt and terminates any other log-on attempts.

  • Continue with this logon, without ending any other logons in system: the SAP Engine 3.0 continues with the current log-on attempt and leaves any other log-on attempts.

  • Terminate this logon: the SAP Engine 3.0 terminates the current log-on attempt.

Buttons

Steer the dialog box buttons.

The following values are available:

  • Confirm Selection: confirm your selection and close the dialog box.

  • Cancel: cancel your selection and close the dialog box.

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 Statusbar

The Module SAP Statusbar allows you to verify information on the SAP Status Bar and the current session.

It has the following ModuleAttributes:

ModuleAttribute

Description

Message

Message that you want to verify. Use ActionMode Verify.

Messagetype

Message type that you want to verify.

The following values are available:

  • Success

  • Warning

  • Error

  • Abort

  • Information

Use ActionMode Verify.

SessionInfo

Information on the current sessions that you want to verify.

The following values are available:

  • Client

  • Flushes

  • InterpretationTime

  • Language

  • Program

  • ResponseTime

  • RoundTrips

  • SystemName

  • Transaction

  • User

Use ActionMode Verify.

You can add this ModuleAttribute to any SAP Engine 3.0 Module.

SAP SubToolBar

The Module SAP SubToolBar allows you to steer SAP SubToolbars.

It has the following ModuleAttributes:

ModuleAttribute

Description

SubToolBar

SubToolbar entry that you want to steer.

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

Steer an SAP SubToolbar

SAP Toolbar

The Module SAP Toolbar allows you to steer SAP Toolbars that contain the transaction code field.

It has the following ModuleAttributes:

ModuleAttribute

Description

Transaction code

Specify the transaction code.

Buttons

Define which action you want to perform.

The following values are available:

  • Enter

  • Save

  • Back

  • Exit

  • Cancel

  • Print

  • Find, Find Next

  • First Page, Previous Page, Next Page, Last Page

  • Help

In this example, you search for transaction code RZ11.

Search for a transaction code

SAP TreeView

The Module SAP TreeView allows you to steer SAP TreeViews.

It has the following ModuleAttributes:

ModuleAttribute

Description

MenuPath

Path to the menu item.

Indicate nodes with ->, for instance Insert->Image.

Use x, X, or no value to select the entry directly.

MenuPath->TreeMenuEntry

Alternatively, you can use ContextMenuEntry to specify the menu item.

Docked Tree-Menu

Path to the menu item that you want to select on a docked TreeView.

Depending on the Technical ID of a TreeView, use either MenuPath or Docked Tree-Menu ModuleAttribute. The default ModuleAttribute is MenuPath.

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

Steer SAP TreeView

SAP Logon - Open with Solution Manager

The Module SAP Logon - Open with Solution Manager allows you to open multiple SAP connections during execution.

It has the following ModuleAttributes:

ModuleAttribute

Description

SapLogonPath

Full path to the SAP Logon GUI.

SapConnection

Name or system ID (SID) of the session that you want to connect to.

SAP Emulated Tree

The Module SAP Emulated Tree allows you to steer SAP Emulated Trees.

It has the following ModuleAttributes:

ModuleAttribute

Description

Tree

Path to an item in the Emulated Tree.

Indicate nodes with ->, for instance NodeA->NodeB.

If more than one entry matches the path, Tricentis Tosca steers the first matching one.

You can replace a node with an index number, for example enter NodeA->#5->NodeC to select the fifth entry in the second node.

Column

Number of the column in the Emulated Tree. The numbering of columns starts from #1.

Columns with cells that don't contain any text are also counted. In some Emulated Trees, such empty cells divide columns (see example below).

Action

Action you want to perform on an item in the Emulated Tree.

The following values are available:

  • {CLICK}

  • {DOUBLECLICK}

  • {RIGHTCLICK}

  • For an icon tooltip: .Tooltip==Tooltip Text

  • For a traffic light: Green, Yellow, Red

ScanAlgorithm

Algorithm that SAP Engine 3.0 uses to navigate through the Emulated Tree.

The following algorithms are available:

  • FastVerticalNoHorizontal - It's the default algorithm for this Module. It vertically scrolls through the Emulated Tree, but doesn't scroll horizontally. This algorithm is not suitable if you want to steer an Emulated Tree that contains a frozen top row.

  • FastVerticalFastHorizontalWithStaticArea - It scrolls both vertically and horizontally through the Emulated Tree. This algorithm takes into account static areas, so it's suitable, for example, to steer an Emulated Tree that contains a frozen top row.

  • DetailedIdentification - It scrolls both vertically and horizontally through the Emulated Tree. This algorithm identifies table cells more accurately so it is suitable for edge cases. You can also use it to steer Emulated Trees with static areas.

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

The Module SAP Emulated Table Tree allows you to steer SAP Emulated Table Trees.

It has the following ModuleAttributes:

ModuleAttribute

Description

Header Table

Steer the main table as described in chapter "Table".

Content Table

Steer the embedded table as described in chapter "Table".

If you want to steer controls embedded in the Emulated Table Tree, for example, traffic lights, you can create them on the <Cell> level of the Module. For detailed information, see chapter "Defining controls in cells".

ScanAlgorithm

Algorithm that SAP Engine 3.0 uses to navigate through the Emulated Table Tree.

The following algorithms are available:

  • FastVerticalNoHorizontal - It vertically scrolls through the Emulated Tree, but doesn't scroll horizontally. This algorithm is not suitable if you want to steer an Emulated Tree that contains a frozen top row.

  • FastVerticalFastHorizontalWithStaticArea - It's the default algorithm for this Module. It scrolls both vertically and horizontally through the Emulated Tree. This algorithm takes into account static areas, so it's suitable, for example, if you want to steer an Emulated Table Tree that contains a frozen top row.

  • DetailedIdentification - It scrolls both vertically and horizontally through the Emulated Tree. This algorithm identifies table cells more accurately so it is suitable for edge cases. You can also use it to steer Emulated Trees with static areas.

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