Tosca Sap Engine en
Tosca Sap Engine en
Tosca Sap Engine en
SAP
Tosca Engine
Table of Contents
Table of Contents
1 Survey 4
1.1 Tosca SAP Engine manual 4
1.2 Legal notice 4
3 Creating Modules 18
3.1 Control types 20
3.2 Screen layout 29
4 Steering controls 32
4.1 Steering tables 35
4.1.1 Table types 46
4.2 Button 52
4.3 Calendar Control 53
4.4 ComboBox 54
4.5 Delay 55
4.6 ListTree 55
4.7 Login/Logout 56
4.8 Logon 57
4.9 SAP Menu 58
4.10 Multilic 59
4.11 OptSubToolbarButton 61
4.12 Popup 61
4.13 RadioButton 62
4.14 Refresh 63
4.15 Send Keys 64
4.16 SpecialToolbar 64
4.17 Statusbar 66
4.18 SubToolbar 68
4.19 TabControl 69
4.20 TableTree 69
4.21 Toolbar 78
4.22 TreeView 78
4.23 WaitStatusChange 81
5 Multi-Session Operations 83
6 Recovery 84
7 Extension of the existing Engine 86
Version 8.3.0 3
1 Survey
1 Survey
SAP Engine manual, version: 03.11.2014
This product contains 3rd party software. You can find a full list, the licenses and the source code where
applicable in the directory %TRICENTIS_HOME%\src\3rdParty.
© by Tricentis GmbH
Version 8.3.0 4
2 Installing the Engine
2.1 Preparations
If one of the following parameters is available, it must have the value FALSE. The
available parameters depend on the SAP version used.
n sapgui/user_scripting_disable_recording
n sapgui/user_scripting_force_notification
n sapgui/user_scripting_per_user
n sapgui/user_scripting_set_readonly
Procedure
Version 8.3.0 5
2 Installing the Engine
2. If the value is currently set to FALSE, select the button Change Value in the
toolbar. A window will be opened in which the new value TRUE can be
entered. When the changes are saved, the window is closed and the current
value of the parameter changes to TRUE.
Version 8.3.0 6
2 Installing the Engine
3. This modification takes effect as soon as the user logs on to the system
again.
4. If the parameter is not found, the respective support package must be
installed according to the list in chapter "Kernel Patchlevels".
If the current value has not changed after saving the modification, the Kernel
patch is too old. Please install a newer Kernel patch in this case.
If the support package is not installed, scripting can be still enabled. For this
purpose, the parameter in the profile file of the Application Server must be set
using the following line:
sapgui/user_scripting = TRUE
This procedure requires the necessary Kernel patchlevel, but does not require a
re-start of the Application Server.
Kernel Patchlevels
Version 8.3.0 7
2 Installing the Engine
Scripting must be installed on the client. This can either be done during the
installation of the SAP GUI or later.
Under Customizing of Local Layout (Alt + F12)->Options->Tab Scripting you can
check whether client-side scripting is installed or not.
In addition, the following user settings must be disabled: Notify When a Script
Attaches to a Running GUI and Notify When a Script Opens a Connection.
Version 8.3.0 8
2 Installing the Engine
If these settings are enabled, a dialog window will be displayed, asking whether a
script should be allowed to connect to the SAP frontend:
Manual settings
The two relevant checkboxes are deselected via Customizing of Local Layout (Alt
+ F12)->Options->Tab >Scripting<-> User Settings.
This setting is disabled by the following registry sequence:
[HKEY_CURRENT_USER\Software\SAP\SAPGUI Front\SAP Frontend
Server\Security]
"UserScripting"=dword:00000001
"WarnOnAttach"=dword:00000000
"WarnOnConnection"=dword:00000000
You can easily check whether scripting is enabled or not by recording and playing
back a chosen sequence of actions. Open the Record and Playback window
under Customizing of Local Layout (Alt+F12) -> Script Recording and Playback.
Version 8.3.0 9
2 Installing the Engine
1. Start recording with a click on Record Script and enter, for example, test into
a text field of your choice.
2. Click on Stop Recording to stop recording. After recording the script, delete
the content of the modified text field.
3. To run the script, click on Playback Script and select the recorded script
(usually stored under the name Script1.vbs). The actions recorded before
should be replayed automatically. If the text field contains the text test again,
the script has been successfully executed.
If the script was executed successfully, the preparations for test automation with
Tosca are finished. No further modifications of the SAP system are required.
After installing Tosca (as described in the installation guide) you can start
automated testing.
Version 8.3.0 10
2 Installing the Engine
In order to scan specific F4 help windows with Tosca Wizard, the option Dialog
(modal) must be selected in the Display section of the F4 Help tab.
Illustration 8: F4 Help
Version 8.3.0 11
2 Installing the Engine
In order to scan F1 help windows, in Modal Dialog Box must be selected under
Display in the F1 Help tab.
Illustration 9: F1 Help
Version 8.3.0 12
2 Installing the Engine
ObjectMappings.dat
[SAP]
handlerClassName=SAPEngine.clsSAPKwds
recoveryClassName=SAPEngine.clsSAPReco
taRepresentationClassName=SAPEngine.clsSAPWindow
scriptHandlerClassName=SAPEngine.clsSAPScriptHandler
wizardItemClassName=SAPEngine.clsSAPWizardItem
[SAPTab]
paRepresentationClassName=SAPEngine.clsSAPTab
omTranslationName=Tabcontrol
[SAPLLOTabControl]
paRepresentationClassName=SAPEngine.clsWin32TabForSAP
omTranslationName=Tabcontrol
[SAPButton]
paRepresentationClassName=SAPEngine.clsSAPButton
omTranslationName=Pushbutton
[SAPToolBar]
paRepresentationClassName=SAPEngine.clsSAPToolbar
omTranslationName=Toolbar
[SAPGridViewToolBar]
paRepresentationClassName=SAPEngine.clsSAPGridView
omTranslationName=Table
Version 8.3.0 13
2 Installing the Engine
[SAPLabel]
paRepresentationClassName=SAPEngine.clsSAPLabel
omTranslationName=Label
[SAPTree]
paRepresentationClassName=SAPEngine.clsSAPTree
omTranslationName=Treeview
[SAPSpecialToolbar]
paRepresentationClassName=SAPEngine.clsSAPSpecialToolbar
omTranslationName=Toolbar
[SAPTable]
paRepresentationClassName=SAPEngine.clsSAPTable
omTranslationName=Table
[SAPPage]
paRepresentationClassName=SAPEngine.clsSAPTable
TableLoaderClassName=SAPEngine.clsPageLoader
omTranslationName=Table
[SAPTableTree]
paRepresentationClassName=SAPEngine.clsSAPTableTree
omTranslationName=Treeview
[SAPTextField]
paRepresentationClassName=SAPEngine.clsSAPTextField
omTranslationName=Editbox
Version 8.3.0 14
2 Installing the Engine
[SAPTextArea]
paRepresentationClassName=SAPEngine.clsSAPTextField
omTranslationName=Editbox
[SAPMenu]
paRepresentationClassName=SAPEngine.clsSAPMenu
omTranslationName=Menu
[SAPContextMenu]
paRepresentationClassName=SAPEngine.clsSAPContextMenu
omTranslationName=Menu
[SAPComboBox]
paRepresentationClassName=SAPEngine.clsSAPComboBox
omTranslationName=Combobox
[SAPRadioButton]
paRepresentationClassName=SAPEngine.clsSAPRadioButton
omTranslationName=Radiobutton
[SAPCheckBox]
paRepresentationClassName=SAPEngine.clsSAPCheckBox
omTranslationName=Checkbox
[SAPCalendar]
paRepresentationClassName=SAPEngine.clsSAPCalendar
; omTranslationName= <kein passender verfügbar>
[SAPStatusBar]
paRepresentationClassName=SAPEngine.clsSAPStatusBar
Version 8.3.0 15
2 Installing the Engine
[SAPGUIContainer]
paRepresentationClassName=SAPEngine.clsSAPGUIContainer
; omTranslationName= <kein passender verfügbar>
WizardMappings.dat
[Class=SAP_FRONTEND_SESSION]
EnginePrefix=SAP
EngineName=SAPEngine
UserControlRepresentationClassName=SAPEngine
.SAPDetailsPage
[SAPLOGON.EXE]
EnginePrefix=SAP
EngineName=SAPEngine
UserControlRepresentationClassName=SAPEngine
.SAPDetailsPage
[SAPGUIRECORD.EXE]
EnginePrefix=SAP
EngineName=SAPEngine
UserControlRepresentationClassName=SAPEngine
.SAPDetailsPage
Depending on what the process is called on the particular system, the following
entry must exist:
Version 8.3.0 16
2 Installing the Engine
[SAPLGPAD.EXE]
EnginePrefix=SAP
EngineName=SAPEngine
UserControlRepresentationClassName=SAPEngine
.SAPDetailsPage
If no assigned engine is found in the WizardMappings.dat file for the test object,
upon scanning with Tosca Wizard, a pop up window will open, prompting the
user to select the appropriate engine to scan the application with(see
Tosca Commander™ Manual).
Version 8.3.0 17
3 Creating Modules
3 Creating Modules
The creation of Modules is described in general in the Tosca Commander™
Manual . In the chapters below you will be provided with engine specific methods
for identifying screens and controls as well as a list of properties and wildcards
and their possible uses in the TechnicalID.
Screen identification
The Context Info can be specified with two different information types:
n Caption of the screen (business-based identification)
This is the title of the screen which is written to the Context Info field. Some
screens in SAP have different business-based names. Thus the Context Info
can be generalized: the context to be steered is always searched starting from
the left (with LeftMatch).
The use of wildcard symbols enables generalizations to be extended. The
Context Info of controls, which may occur on several screens (e.g. menu
steering), can thus be set to *. This ensures that the first main screen is used
for steering.
Version 8.3.0 18
3 Creating Modules
{RegEx[Styleg.*: C.*box]}
instead of
Styleguide: Checkbox
Control identification
IDs are required for identifying the controls to be steered. These are displayed as
SAP-ID in Tosca Wizard and must be entered under the attribute TechnicalID in
the control tag. Tosca Wizard does this automatically.
Static IDs
All controls that exist in a SAP session at a particular point of time usually have
static IDs. This means that the IDs of the controls do not change during runtime.
The entire ID of the corresponding controls is scanned as a TechnicalID (default
behavior of Tosca Wizard).
Dynamic IDs
In exceptional cases, dynamic IDs are assigned to containers which contain the
controls to be steered. In these cases the dynamic part may be replaced by a
wildcard (*), or a Body ID can be used for identification. Please note the following
when using wildcards:
n Wildcards can only be used for controls in the UserArea, i.e. the path must
start from level /usr/...
n Body IDs must not be used in paths.
n Only one wildcard may be used per level.
Version 8.3.0 19
3 Creating Modules
Regular expressions can also be used for the entire ID expression. However, the
dynamic part cannot be replaced with a regular expression.
{RegEx[/usr/.*/txtF1]}
instead of
/usr/subSA_0100_1:SAPLEXAMPLE_ENTRY_
SCREEN:0200/subSA_200_2:SAPLEXAMPLE_ENTRY_
SCREEN:1200/txtF1
Version 8.3.0 20
3 Creating Modules
SAPTextField
SAPComboBox
SAPCheckBox
SAPTabControl
Version 8.3.0 21
3 Creating Modules
SAPTable
Version 8.3.0 22
3 Creating Modules
Version 8.3.0 23
3 Creating Modules
SAPTableTree
Version 8.3.0 24
3 Creating Modules
Version 8.3.0 25
3 Creating Modules
SAPTree
SAPStatusBar
SAPRadioButton
Version 8.3.0 26
3 Creating Modules
SAPMenu
SAPSpecialToolbar
SAPCalendar
Version 8.3.0 27
3 Creating Modules
SAPTextArea
Version 8.3.0 28
3 Creating Modules
SAPContextMenu
Main window
Main windows are the standard case, and they are structured as follows:
Version 8.3.0 29
3 Creating Modules
The upper part of the window contains the SAP Menu (see chapter 4.9 "SAP
Menu"). Depending on the operation, different functions are available via the SAP
Menu.
The SAP Toolbar is located (see chapter 4.21 "Toolbar") beneath the SAP Menu. It
is always structured in the same way and provides buttons for general functions
such as Enter, Back, Cancel, etc. and the text field for entering transaction codes.
The SAP status bar in the lower part of the screen shows messages for currently
performed actions (OK, notes, errors) (see chapter 4.17 "Statusbar").
The area between the SAP toolbar and the SAP status bar contains information
for the corresponding transactions. This area may contain simple controls (such
as buttons or text fields) that can be scanned collectively in Modules, and further
toolbars, tables, tree views etc., that can be used via pre-made Modules.
Version 8.3.0 30
3 Creating Modules
If a modal window is active, text cannot be input in the main parent window. The
modal window must be steered first.
Version 8.3.0 31
4 Steering controls
4 Steering controls
This chapter describes the SAP Engine specific control steering. Some SAP
controls can be steered using specific Modules. These SAP Engine Modules can
be downloaded from the Tosca Exchange Portal.
For further information on general control steering, please see also the Tosca
Commander™ Manual.
Click operations
Click operations are specified via the Action row and the ActionMode Input.
If simple controls should be steered, this requires click operations to be specified
with curly brackets. Table steering does not need curly brackets since this is an
action. Mouse commands are not case-sensitive.
The Tosca SAP Engine supports the following click operations:
Version 8.3.0 32
4 Steering controls
Version 8.3.0 33
4 Steering controls
Version 8.3.0 34
4 Steering controls
The engine enables to limit the number of rows to be loaded when loading
tables. This requires the attribute RowFilter to be newly created for the table
control (ObjectCustomControlAttribute).
The TestStepValue RowFilter specifies the rows to be loaded. This may include
either individual rows or even a certain area. If no value is defined, the entire
table will be loaded.
Version 8.3.0 35
4 Steering controls
#42,#123,#789
The rows 42, 123 and 789 are loaded.
#7-#58
All rows from 7 to 58 are loaded.
#42-END
All rows from row number 42 to the last row are loaded.
If tables are steered whose rows are restricted, the specified row number
indicates the loaded table rather than the original table.
If for instance the rows 42, 123 and 789 were loaded, the value #2
must be specified as a row number for steering row 123.
Input
To enter a value into a cell, the value must be specified under Action. The
required cell is specified via Row and Column. The cell in the test object must be
editable upon steering.
In the first row of the column Material the value M-08 should be
entered.
Version 8.3.0 36
4 Steering controls
WaitOn
The ActionMode WaitOn suspends the execution of the TestCase until the
corresponding control receives the value or property specified under Value. (For
detailed information, please refer to the Tosca Commander™ Manual.)
Baseline comparison
It is possible to compare the entire content of a table upon each execution to its
content during an earlier execution.
For this purpose, the ActionMode of the table is set to Verify and .baseline is
entered under Aktion.
Version 8.3.0 37
4 Steering controls
If a baseline comparison is performed for the first time, an XML file (base file) is
created and stored in the base file directory. This directory is specified in the
Settings dialog under Engine->BaseLines->Directory.
During each additional execution another XML file (current file) is created and
compared to the base file. If differences occur during an execution, a verification
error is raised and written to the ExecutionLog. The directory of the current XML
file is specified in the Settings dialog under Engine->BaseLines->Dumps.
From Tosca version 6.3.3 on, SAP table modules have the attribute Baseline
Filename, in which the baseline name can be specified.
If no name is specified or if an older Tosca version is used, the baseline name is
generated according to the following schema:
<TestCase name>_<Table name><UniqueID of the table>_<TestStep
name>.xml
Dynamic values such as order numbers cause an error and must not be
considered. For this purpose, the row or column is specified under
Unberücksichtigte Zeile (Ignore rows) or Unberücksichtigte Spalte (Ignore
columns). If the table content needs to be modified, the base file can be
overwritten with the current XML file (Current File) via Set Dump to Baseline.
Tosca Commander™ can hide rows and columns while steering SAP tables.
Hidden parts of the table cannot be steered and are not considered during
verification. This function is specified as follows:
n Irrelevant rows
Rows to be ignored upon steering are indicated here. Possible values are
numeric row numbers with initial hash sign (#) and business-based values. The
rows are specified separated by semicolons.
Example: #2;Rownumber;#17
Skips the rows 2 and 17 as well as all rows which contain the value
Rownumber.
n Irrelevant columns
Columns to be ignored upon steering are indicated here. Possible values are
numeric column numbers. The columns are specified separated by
semicolons.
Example: 2;5
Skips the columns 2 and 5.
Tables may contain a traffic light value that can be verified. For this purpose, the
ActionMode of the table is set to Verify and the color to be verified (Green,
Version 8.3.0 38
4 Steering controls
Yellow, Red - entry is case sensitive!) is specified for the attribute Aktion.
The Tosca Commander™ Manual contains a detailed desciption of how to specify
rows and columns.
The tooltip of a cell can be verified by using the following syntax for Action:
Syntax: .ToolTip=<Tooltip>
In this way, the tooltip of the cell that is defined by Row and Column can be
verified.
The following TestStep verifies whether the tooltip of the fourth row
in the third column of the specified table has the value Green.
Version 8.3.0 39
4 Steering controls
Tosca enables to determine the last row that was filled with data already upon
runtime. This is for instance necessary if the value of the last row should be
verified. For this purpose #LastContentRow is specified under the attribute Row.
The Tosca SAP Engine allows you to read row and column numbers in order to
perform verify or buffer operations with the values. For this purpose, .row (row
number) or .col (column number) must be specified for the Property.
The following example verifies whether the second row is the last
row with content:
Version 8.3.0 40
4 Steering controls
Version 8.3.0 41
4 Steering controls
The Tosca SAP Engine allows the number of row and column occurrences to be
read out in order to perform verify or buffer operations with these values. For
this purpose, .rowcount (row occurrences) or .colcount (column occurrences)
must be specified under Property.
Version 8.3.0 42
4 Steering controls
Decisive Column
Individual columns of a table can be entirely filled with standard data (e.g.
currencies or dates). The cells of these columns do not necessarily have to
contain relevant data. A column that contains relevant data is referred to as
Decisive Column.
The Tosca SAP Engine reads only rows which contain concrete values. For this
purpose the following syntax is used for the Steering property:
Version 8.3.0 43
4 Steering controls
The value LastContentRow can be used with a table column which has
been predefined as DecisiveCol. Hereby the last row of the table
column that contains a value is determined. By specifying
DecisiveCol=2 the second column is used. In the table above this is
the Price column. The value Test is to be entered into the second
Version 8.3.0 44
4 Steering controls
column's last row that is filled with data. In the table above, the value
12,000 of the Price column would be replaced by Test.
If no column name is specified, only row numbers will be read. Values that exist
twice are only read once. Empty values are not used.
Version 8.3.0 45
4 Steering controls
TableControls (GUITable)
Tables of the type GUITable are default tables. These tables can be included in
the ObjectMap without any additional special treatment by selecting them in
Tosca Wizard.
Emulated tables optically look like normal tables. From a technical point of view
they are not tables, but collections of labels. Emulated tables can be steered with
the control SAPTable.
Version 8.3.0 46
4 Steering controls
Version 8.3.0 47
4 Steering controls
Emulated tables often have an ambiguous table structure that may contain
different column arrangements per row and complex header areas. The
additionally required steering information can be specified in Tosca Wizard when
the table is scanned and stored in the control SAPTable under the property
Steering.
Version 8.3.0 48
4 Steering controls
Tosca Wizard provides an additional format for tables, for which additional
properties can or must be specified. With the checkbox Is Table activated,a
preview of the table layout is displayed.
n Header row: Number of the row, in which the header is located. This Attribute
is used as an alternative to Header. The row number is displayed in the ID of
the respective cell element (visible in Tosca Wizard): The ID is structured as
follows:
[<column index>,<row index>]
If no header exists, headerRow=-1 must be set. The default value is
headerRow=0.
n Header: List of concrete column names. For tables with a header that cannot
be read, but that have a logical header, the column names can be specified
separated by commas.
n Data start row: Number of the row, in which the first data row is located.
Default value is headerRow+1.
Version 8.3.0 49
4 Steering controls
n Data end row: Row number of the last data row to be read. For
EmulatedTables, which do not reach the end of the screen it is possible to
specify the index of the last row that is part of the table in order to stop the
reading process.
n Identify table by header: If two or more emulated tables are located on a SAP
screen one below the other, beginning from the second table, the header row
cannot be specified absolutely, as the number of rows of the first table is not
known at the time of scanning. In this case Identify table by header must be
specified. Thus the Engine searches for a row with the column names specified
under Header and sets it as Header row. Data start row is also specified
relatively to this row.
n List of column positions: List of the starting positions of relevant columns. In
order to keep the data volume to be loaded as small as possible, a list of
relevant column positions for the loading process can be specified. The
column indices can be read off from the ID of the respective cell element
(visible in Tosca Wizard). The ID is structured as follows:
[<column index>,<row index>].
If List of column positions is set and no explicit header is specified, the
positions that are defined here are also used for the specification of the
header.
n Row shift: Some tables have rows that are only used to structure the table
layout, but do not contain any relevant data. These rows must be blanked out
during the loading process of the table in Tosca. In such a case rowShift must
specify for how many rows the row number must be raised in order to receive
the next reasonable data row. The default value of rowShift is 1.
n Row Height: Specifies the height of the row. Some logical rows cover several
row indices. The default value is 1.
GUISimpleContainer (GUISimpleContainer)
Version 8.3.0 50
4 Steering controls
GridViews are represented in Tosca by one single control, but normally they
include a corresponding toolbar that provides table-specific functionalities.
Version 8.3.0 51
4 Steering controls
The toolbar is steered by the Attribute ToolbarItem. Individual items are steered
like the SAP SpecialToolbar (see chapter 4.16 "SpecialToolbar").
The modification of a GridView table’s column width may affect the length of the
displayed column name. The Tosca SAP Engine allows the static tooltip of a
GridView table to be steered.
To steer GridView tables via the tooltip, the property ColNameFromTooltip must
either have the value True in the table steering or the setting Get column name
from Tooltip (see Tosca Commander™ Manual - Settings - Special Engines - SAP
Engine) must have the value Yes. If the property ColNameFromTooltip exists on
the Module level, it overwrites the general setting Get column name from
Tooltip. If this property has the value False or another value, the column name is
determined on the basis of the displayed (dynamic) header. The property
ColNameFromTooltip must be created manually via the Properties tab of the
GridView table (on the ModuleAttribute level) by using the option Create
parameter - _New.
4.2 Button
The Module SAP Buttons allows buttons to be steered which are not embedded
into a toolbar.
Version 8.3.0 52
4 Steering controls
Steering options
Version 8.3.0 53
4 Steering controls
4.4 ComboBox
The SAP ComboBox can be steered with Tosca Wizard.
Input
The SAP ComboBox supports the input of key and value and thus allows values
to be used from a ComboBox . If the combination cannot be found, the engine
searches the value list.
Syntax: <key><space><value>
In the example below, the value 97 Kreditlimit is selected from the ComboBox
Liefersperre and 03 Preise unvollständig is selected from the ComboBox
Fakturasperre.
Verify
Version 8.3.0 54
4 Steering controls
4.5 Delay
The Module SAP Delay can be used to define a wait time in a TestCase. The time
is specified in milliseconds.
4.6 ListTree
SAP ListTrees are SAP TableTrees of the type ListTree. SAP ListTrees can be
scanned using Tosca Wizard.
Input
If rows to be selected are entered, the path must be specified with wildcards. This
is necessary since the visible name does not always match the entire name.
If a name is part of another name, the entry must be specified using an Exact
Match Delimiter.
Version 8.3.0 55
4 Steering controls
4.7 Login/Logout
The Module SAP Login is used to enter user-specific data of a certain user into
the SAP Login screen.
Login procedure:
Version 8.3.0 56
4 Steering controls
Logout
The Modules SAP Menü and SAP Popup Frage are used for logging off from SAP.
4.8 Logon
The Module SAP Logon can be used to select an SAP system from the SAP Logon
window. The selected system is double clicked on in order to open the login
screen.
Version 8.3.0 57
4 Steering controls
To start an SAP system, the Module SAP Logon should always be used. The Logon
screen cannot be scanned with the Tosca SAP Engine, as it cannot be steered via
the SAP Scripting interface.
Version 8.3.0 58
4 Steering controls
ActionMode Input
Specific menu entries can be steered by specifying the respective menu paths.
Any menu nodes must be separated by ->.
ActionMode Verify
The following syntax must be used in order to verify the property of a menu
entry:
4.10 Multilic
The Module SAP Multilic is used for steering the modal dialog License
information for Multiple Logon. This dialog opens whenever a user tries to log
on to the system several times.
Specify the caption of the dialog window to be steered in the Properties tab of
the Module for the parameter CaptionList. If you would like to specify more than
one caption in various languages, they must be separated by semicolons.
Version 8.3.0 59
4 Steering controls
The modal dialog can be steered with the three options beneath the RadioButton
Anmeldungsoption. The TestStepValue Button confirms the selected entry.
If the modal dialog box does not appear, an error will not be displayed during
test execution.
Version 8.3.0 60
4 Steering controls
4.11 OptSubToolbarButton
A button in the second row of a toolbar can be steered using the SAP
OptSubToolbarButton Module.
4.12 Popup
Standard pop-up menus can be steered with the following three Modules: SAP
Popup, SAP Popup Frage and SAP Popup Info. Any new pop-up menus can be
scanned using Tosca Wizard.
Version 8.3.0 61
4 Steering controls
4.13 RadioButton
The method to steer SAP RadioButtons is different for simple RadioButtons (see
chapter "ControlSimple") and for RadioButtons that are part of a ControlGroup
(see chapter "ControlGroup")
ControlSimple
Input
Simple SAP RadioButtons can be selected via the ActionMode Input and the value
X.
Verify
To verify if a simple SAP RadioButton has been selected, the following syntax is
required:
Syntax: .value=X
To verify if a simple SAP RadioButton has not been selected, the following syntax
is required:
Syntax: .value=<space>
ControlGroup
Input
SAP RadioButtons that are part of a ControlGroup can be selected via the
ActionMode Input. The name of the desired RadioButton is specified under
Value.
Verify
Version 8.3.0 62
4 Steering controls
Syntax: Control.value=X
Syntax: Control.value=<space>
4.14 Refresh
The SAP Refresh Module allows a window to be refreshed several times until
either a defined message is shown or a defined number of attempts is reached.
ModuleAttribute Description
Version 8.3.0 63
4 Steering controls
ModuleAttribute Description
4.16 SpecialToolbar
Special toolbars are mostly used along with tables or tabs. The Module SAP
SpecialToolbar is used for steering SpecialToolbars.
The following control types may exist in a SpecialToolbar:
Version 8.3.0 64
4 Steering controls
Creating Toolbars
You are able to add any number of new TableTrees to the Module SAP
SpecialToolbar.
1. Select the ModuleAttribute Toolbar in the Module SAP SpecialToolbar.
2. Select the option Create ControlGroupItem from the context menu of the
attribute.
A name and a TechnicalID must be entered for the new toolbar. The TechnicalID
is determined using Tosca Wizard.
3. Scan the required window using Tosca Wizard. The Technical ID is displayed
in Tosca Wizard in the SAP ID field of the required SpecialToolbar.
4. Copy the value of the SAP ID of the SpecialToolbar to the clipboard.
5. Close Tosca Wizard. The Module is not saved.
Version 8.3.0 65
4 Steering controls
6. Select the ModuleAttribute Toolbar in the left window section of Tosca
Commander™.
7. Switch to the right section of the window, go to the Properties tab and select
the newly created toolbar.
8. Copy the value of the property SAP ID to the Value column of the property
TechnicalId.
Defining TestSteps
1. Select the toolbar to be steered from the drop-down menu in the Value field
of the TestStepValue Toolbar.
2. Specify the name of the control to be steered in the TestStepValue
ToolbarItem.
The table "Control types" lists all control types that may exist in a SpecialToolbar.
The Description column illustrates the actions that are performed when the
respective control is steered.
4.17 Statusbar
In SAP, status messages are shown in the status bar. These messages can be
verified using both the Module SAP Statusbar and the ActionMode Verify. You
can verify the text of the status message and its type (error, hint, ok).
Version 8.3.0 66
4 Steering controls
Dynamic text fragments can be written to the buffer (XBuffer) and read out if
required. For further information on the XBuffer, see Tosca Commander™
Manual.
The message type error can explicitly prevent the test execution from being
aborted. This behavior can, for instance, be used in negative tests to verify if a
particular error message appears.
To verify additional properties of the SAP Statusbar, these can be added to any
Module. For this purpose, the ModuleAttribute Statustext is copied to the
required Module. The following properties can be verified:
Version 8.3.0 67
4 Steering controls
4.18 SubToolbar
The Module SAP SubToolbar can be used for steering specific buttons. The sub-
toolbar may contain different elements depending on the screen used.
Version 8.3.0 68
4 Steering controls
4.19 TabControl
The Module SAP TabControl allows individual tabs of a screen to be accessed.
The TestStepValue Tab specifies the name of the tab to be steered.
The ActionMode Verify checks if the SAP TabControl is currently active. The
following syntax must be used in order to verify whether a certain tab exists:
4.20 TableTree
The Module SAP TableTree is used for steering table trees.
Unlike TreeViews, TableTrees contain a tree in the first column and tables in the
second column. Therefore, the Module SAP TableTree contains the attributes
Zeile (row), Spalte (column) and Aktion (action).
Version 8.3.0 69
4 Steering controls
Creating TableTrees
You can add any number of new TableTrees to the Module SAP TableTree.
1. Select the ModuleAttribute TreeView in the Module SAP TableTree.
2. Select the option Create ControlGroupItem from the context menu of the
attribute.
A name and a TechnicalID must be entered for the new TableTree. The
TechnicalID is determined using Tosca Wizard.
3. Scan the required window using Tosca Wizard. The technical ID is displayed
in Tosca Wizard in the SAP ID field of the required TableTree.
4. Copy the value of the SAP ID of the TableTree to the clipboard.
5. Close Tosca Wizard. The Module is not saved.
Version 8.3.0 70
4 Steering controls
6. Select the ModuleAttribute TreeView in the left window section of Tosca
Commander™.
7. Switch to the right section of the window, go to the Properties tab and select
the newly created TableTree.
8. Copy the value of the property SAP ID to the Value column of the property
TechnicalId.
Defining TestSteps
1. Select the TableTree to be steered from the drop-down menu in the Value
field of the TestStepValue TreeView.
2. In the TestStepValue Zeile (row), define the path to the required node (see
chapter 4.22 "TreeView").
3. 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.
Version 8.3.0 71
4 Steering controls
Syntax Description
{click}, {dblclick}, Click with the left mouse button, double-click with
{rightclick} 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.
Table 4: Actions
4. Define the column to the steered via the TestStepValue Spalte, if needed.
Verifying ChildNodes
It is possible to verify how many ChildNodes a node contains. Thus under Zeile
(row) the path to the desired node is specified. Under Aktion (action)
.childCount=n is entered and the ActionMode is set to Verify.
Version 8.3.0 72
4 Steering controls
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.
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:
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.
Version 8.3.0 73
4 Steering controls
Nodes of TableTrees may receive a traffic light value that can be verified. For this
purpose, under Zeile (row), the path to the desired element is specified, in the
row Aktion (action), the ActionMode is set to Verify and under Value, the color
(Green, Yellow, Red) is specified.
This entry is case sensitive! Under Spalte (column) Trafficlight must be entered.
TableTrees may contain icons with names which can be verified. Under Zeile
(row), the path to the desired symbol is specified, in the row Aktion (action), the
ActionMode is set to Verify, and under Value, the name of the icon is specified.
Under Spalte (column), theIconName must be entered.
Version 8.3.0 74
4 Steering controls
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.
Emulated Trees
Version 8.3.0 75
4 Steering controls
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 Tosca SAP Engine can switch
between steering the header text and the column name.
For this purpose, the parameter IdentifyColumnBy (please note that the
parameter is case sensitive) must be created in the ObjectMap of the SAP
TableTree Module.
Using templates
Procedure
1. 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]
Version 8.3.0 76
4 Steering controls
2. The row indicates the node from which the child elements are to be written
to the Excel sheet.
3. In addition, the TestCase name, the name of the parent node and the table
tree name are also copied to the Excel sheet.
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:
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]
Version 8.3.0 77
4 Steering controls
4.21 Toolbar
The Module SAP Toolbar allows both the input field for transaction codes and
toolbar buttons to be accessed.
The following syntax enables to verify whether a control exists in the toolbar:
4.22 TreeView
The Module SAP TreeView is used for steering simple TreeViews.
The attributes Menupath and Docked Tree-Menu are provided in the Module
SAP TreeView. The Technical ID of the respective TreeView to be steered
determines which attribute is to be used. By default, the ModuleAttribute
Menupath is used.
Version 8.3.0 78
4 Steering controls
This control type can be used in several Modules. For this purpose, the
ModuleAttribute Menupath or Docked Tree-Menu must be copied to the
required Module.
The TestStepValue indicates the path to the menu item to be selected. The
elements (levels) are specified separated by -> characters. The last element is
double-clicked.
If the first level is a dynamic value, the paths can be specified starting with the
second level. Relative paths must begin with an arrow.
The following syntax is used for performing drag and drop operations on an
item:
Syntax: {Drag(Level1->Level2->...->item)}
Version 8.3.0 79
4 Steering controls
{Drop(Level1->Level2->...->item)}
Identical entries
If several entries of the same name exist on one level, they can be steered using
an index in square brackets [ ].
IDoc->Data records->E1OILT1->E1OILT2[3]
Version 8.3.0 80
4 Steering controls
4.23 WaitStatusChange
The Module SAP WaitStatusChange allows dynamic status messages to be
verified in the status bar.
n The first value of the status bar is specified in the attribute From.
n The modified value of the status bar is specified in the attribute To.
Version 8.3.0 81
4 Steering controls
n MaxWait defines the time to be waited until the modified value of the status
message is displayed. This wait time is specified in seconds.
Version 8.3.0 82
5 Multi-Session Operations
5 Multi-Session Operations
It is possible to administrate several SAP sessions (Connections) at the same
time. This option must be enabled via the Settings dialog (see Tosca
Commander™ Manual - Settings - Special Engines - SAPEngine - Allow Multiple
SAP Connections). The session with the specified TechnicalID is searched for. If an
* is specified as TechnicalID, the last active window is searched for.
Version 8.3.0 83
6 Recovery
6 Recovery
In the case of a recovery, the correct initial situation must be re-established for
the test cases. If the setting TestCaseStartScreen (see Tosca Commander™
Manual - Settings - Special Engines - SAPEngine) is set to SAP Easy Access, the
steering must first log on to the system to be able to execute the next test case.
For the login the following steps must be conducted:
n Start the application SAP (see Tosca Commander™ Manual - Settings - Special
Engines - SAPEngine - SAP Logon Path)
n Select the system (see Tosca Commander™ Manual - Settings - Special Engines
- SAPEngine - Recovery)
n Specify SysID, Mandant, UserID and password (see Tosca Commander™
Manual - Settings - Special Engines - SAPEngine - Recovery)
This setting specifies which system must be selected. The Engine is able to
remember the system in which the last test case was executed (in the Buffer
under the key lastSAPSystem), but in SAP only the system ID can be read.
However, a system is accessed via the system name. Thus the setting System
offers the option to find a system name for a system ID.
The Engine is able to remember the system and client in which (in the Buffer
under the key lastSAPClient) and under which user (in the Buffer under the key
lastSAPUser) the last test case was executed, but the password of the current
logged-in user cannot be read from SAP. Thus it is necessary to provide a
password under the setting User for the Engine to log on to the client.
The passwords are stored unencrypted. This should not cause any problems, as
these are the passwords of test users.
Additionally, the last used language is stored in the Buffer under the key
lastSAPLanguage.
Sub Main(testAction)
' Helper for Recovery, if setting "Special Engines.SAPEngine.Startscreen
of Testcases" == SAP Easy Access
' (While recovering, SAP Engine has to log in into last used system/client
using last used test user)
' Keyword's module has to be from screentype "SAP"
' SAP Modules provide the settings object as global "oSAPSettings"
' 2 Systems available: 01 Tricentis (ID=T01, Client 200), 02 Tricentis
(ID=T02, Clients 100, 200)
' 2 Test user should be able to log in for all System's Clients: test01, test02
Version 8.3.0 84
6 Recovery
Version 8.3.0 85
7 Extension of the existing Engine
The SAP Engine offers the following objects for creating keywords with VBScript:
Name Type
oSAPProxy SAPEngine.clsSAPProxy
oSAPSettings SAPEngine.clsSAPSettings
Table 5: SAP objects
The object oSAPProxy contains the initialized session which enables the SAP
application to be steered to be accessed. In order to ensure that derived classes
are able to use the available connection, an instance of the class clsSAPObjServer
must be created. The session, which has been initialized beforehand, can thus be
collected via the method GetServiceObject("SAPProxy").
Version 8.3.0 86