Click Element

Arguments

  • element_id

Performs a single click on a given element. Used only for buttons, tabs and menu items.

In case you want to change a value of an element like checkboxes of selecting an option in dropdown lists, use select checkbox or select from list by label instead.

Click Toolbar Button

Arguments

  • table_id
  • button_id

Clicks a button of a toolbar within a GridView 'table_id' which is contained within a shell object. Use the Scripting tracker recorder to find the 'button_id' of the button to click

Connect To Existing Connection

Arguments

  • connection_name

Connects to an open connection. If the connection matches the given connection_name, the session is connected to this connection.

Connect To Session

Arguments

  • explicit_wait=0

Connects to an open session SAP.

See Opening a connection / Before running tests for details about requirements before connecting to a session.

Optionally set explicit wait can be used to set the explicit wait time.

Examples:

Keyword Attributes
connect to session
connect to session 3
connect to session explicit_wait=500ms

Disable Screenshots On Error

Arguments

Disables automatic screenshots on error.

Doubleclick Element

Arguments

  • element_id
  • item_id
  • column_id

Performs a double-click on a given element. Used only for shell objects.

Element Should Be Present

Arguments

  • element_id
  • message=None

Checks whether an element is present on the screen.

Element Value Should Be

Arguments

  • element_id
  • expected_value
  • message=None

Checks whether the element value is the same as the expected value. The possible expected values depend on the type of element (see usage).

Usage:

Element type possible values
textfield text
label text
checkbox checked / unchecked
radiobutton checked / unchecked
combobox text of the option to be expected

Element Value Should Contain

Arguments

  • element_id
  • expected_value
  • message=None

Checks whether the element value contains the expected value. The possible expected values depend on the type of element (see usage).

Usage:

Element type possible values
textfield text
label text
combobox text of the option to be expected

Enable Screenshots On Error

Arguments

Enables automatic screenshots on error.

Get Cell Value

Arguments

  • table_id
  • row_num
  • col_id

Returns the cell value for the specified cell.

Get Element Location

Arguments

  • element_id

Returns the Sap element location for the given element.

Get Element Type

Arguments

  • element_id

Returns the Sap element type for the given element.

Get Row Count

Arguments

  • table_id

Returns the number of rows found in the specified table.

Get Scroll Position

Arguments

  • element_id

Returns the scroll position of the scrollbar of an element 'element_id' that is contained within a shell object.

Get Value

Arguments

  • element_id

Gets the value of the given element. The possible return values depend on the type of element (see Return values).

Return values:

Element type Return values
textfield text
label text
checkbox checked / unchecked
radiobutton checked / unchecked
combobox text of the selected option
guibutton text
guititlebar text
guistatusbar text

Get Window Title

Arguments

  • locator

Retrieves the window title of the given window.

Input Password

Arguments

  • element_id
  • password

Inserts the given password into the text field identified by locator. The password is not recorded in the log.

Input Text

Arguments

  • element_id
  • text

Inserts the given text into the text field identified by locator. Use keyword input password to insert a password in a text field.

Maximize Window

Arguments

  • window=0

Maximizes the SapGui window.

Open Connection

Arguments

  • connection_name

Opens a connection to the given connection name. Be sure to provide the full connection name, including the bracket part.

Run Transaction

Arguments

  • transaction

Runs a Sap transaction. An error is given when an unknown transaction is specified.

Scroll

Arguments

  • element_id
  • position

Scrolls the scrollbar of an element 'element_id' that is contained within a shell object. 'Position' is the number of rows to scroll.

Select Checkbox

Arguments

  • element_id

Selects checkbox identified by locator. Does nothing if the checkbox is already selected.

Select Context Menu Item

Arguments

  • element_id
  • menu_or_button_id
  • item_id

Selects an item from the context menu by clicking a button or right-clicking in the node context menu.

Select From List By Label

Arguments

  • element_id
  • value

Selects the specified option from the selection list.

Select Node

Arguments

  • tree_id
  • node_id
  • expand=False

Selects a node of a TableTreeControl 'tree_id' which is contained within a shell object.

Use the Scripting tracker recorder to find the 'node_id' of the node. Expand can be set to True to expand the node. If the node cannot be expanded, no error is given.

Select Radio Button

Arguments

  • element_id

Sets radio button to the specified value.

Select Table Column

Arguments

  • table_id
  • column_id

Selects an entire column of a GridView 'table_id' which is contained within a shell object.

Use the Scripting tracker recorder to find the 'column_id' of the column to select.

Select Table Row

Arguments

  • table_id
  • row_num

Selects an entire row of a table. This can either be a TableControl or a GridView 'table_id' which is contained within a shell object. The row is an index to select the row, starting from 0.

Send Vkey

Arguments

  • vkey_id
  • window=0

Sends a SAP virtual key combination to the window, not into an element. If you want to send a value to a text field, use input text instead.

To send a vkey, you can either use te VKey ID or the Key combination.

Sap Virtual Keys (on Windows)

VKey ID Key combination VKey ID Key combination VKey ID Key combination
0 Enter 26 Ctrl + F2 72 Ctrl + A
1 F1 27 Ctrl + F3 73 Ctrl + D
2 F2 28 Ctrl + F4 74 Ctrl + N
3 F3 29 Ctrl + F5 75 Ctrl + O
4 F4 30 Ctrl + F6 76 Shift + Del
5 F5 31 Ctrl + F7 77 Ctrl + Ins
6 F6 32 Ctrl + F8 78 Shift + Ins
7 F7 33 Ctrl + F9 79 Alt + Backspace
8 F8 34 Ctrl + F10 80 Ctrl + Page Up
9 F9 35 Ctrl + F11 81 Page Up
10 F10 36 Ctrl + F12 82 Page Down
11 F11 or Ctrl + S 37 Ctrl + Shift + F1 83 Ctrl + Page Down
12 F12 or ESC 38 Ctrl + Shift + F2 84 Ctrl + G
14 Shift + F2 39 Ctrl + Shift + F3 85 Ctrl + R
15 Shift + F3 40 Ctrl + Shift + F4 86 Ctrl + P
16 Shift + F4 41 Ctrl + Shift + F5 87 Ctrl + B
17 Shift + F5 42 Ctrl + Shift + F6 88 Ctrl + K
18 Shift + F6 43 Ctrl + Shift + F7 89 Ctrl + T
19 Shift + F7 44 Ctrl + Shift + F8 90 Ctrl + Y
20 Shift + F8 45 Ctrl + Shift + F9 91 Ctrl + X
21 Shift + F9 46 Ctrl + Shift + F10 92 Ctrl + C
22 Ctrl + Shift + 0 47 Ctrl + Shift + F11 93 Ctrl + V
23 Shift + F11 48 Ctrl + Shift + F12 94 Shift + F10
24 Shift + F12 70 Ctrl + E 97 Ctrl + #
25 Ctrl + F1 71 Ctrl + F

Examples:

Keyword Attributes
send_vkey 8
send_vkey Ctrl + Shift + F1
send_vkey Ctrl + F7 window=1

Set Explicit Wait

Arguments

  • speed

Sets the delay time that is waited after each SapGui keyword.

The value can be given as a number that is considered to be seconds or as a human-readable string like 1 second or 700 ms.

This functionality is designed to be used for demonstration and debugging purposes. It is not advised to use this keyword to wait for an element to appear or function to finish.

Possible time formats:

miliseconds milliseconds, millisecond, millis, ms
seconds seconds, second, secs, sec, s
minutes minutes, minute, mins, min, m

Example:

Keyword Attributes
Set explicit wait 1
Set explicit wait 3 seconds
Set explicit wait 500 ms

Set Focus

Arguments

  • element_id

Sets the focus to the given element.

Take Screenshot

Arguments

  • screenshot_name=sap-screenshot

Takes a screenshot, only if 'screenshots on error' has been enabled, either at import of with keyword enable screenshots on error.

This keyword uses Robots' internal Screenshot library.

Unselect Checkbox

Arguments

  • element_id

Removes selection of checkbox identified by locator. Does nothing if the checkbox is not selected.