Keys Method (Mobile Objects)

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Types text in the active application and object on the connected mobile device.

Declaration

TestObj.Keys(Keys)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Keys [in]    Required    String    
Result None

Applies To

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Parameters

The method has the following parameter:

Keys

The text to type. It can include special keys from the following table:

Code Simulated Key
^ Ctrl
! Shift
~ Alt
^^ ^
!! !
~~ ~
[[ [
[Apps] App switch key
[BS] Backspace
[Clear] Clear
[Del] Delete
[Down] Down
[End] End
[Enter] Enter
[Esc] Back
[F1] F1
[F2] F2
[F3] F3
[F4] F4
[F5] F5
[F6] F6
[F7] F7
[F8] F8
[F9] F9
[F10] F10
[F11] F11
[F12] F12
Code Simulated Key
[Home] Home
[Ins] Insert
[Left] Left
[NumAsterisk] Num * (* on the numeric keyboard)
[NumMinus] Num - (- on the numeric keyboard)
[NumPlus] Num + (+ on the numeric keyboard)
[NumSlash] Num / (/ on the numeric keyboard)
[PageDown] Page Down
[PageUp] Page Up
[Pause] Pause
[Right] Right
[Tab] Tab
[Up] Up
[Win] Home key
[Pnnn] Pauses typing for nnn milliseconds.
All constants (F1, PageDown, X, P, etc.) are case-sensitive.

Result Value

None.

Remarks

  • On Android devices, the Device.Keys method only supports Latin characters.

    The Element.Keys method also supports only Latin characters by default. To enable the Element.Keys method to support other character sets, use the unicodeKeyboard and resetKeyboard capabilities when opening a testing session on your Android device.

  • On iOS devices, the Keys method may fail to simulate pressing special keys, like SHIFT, CTRL, ALT, or Backspace.

See Also

About Mobile Tests

Highlight search results