Device Keys Operation

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

The Device Keys operation types text in the active application and object on a mobile device.

Requirements

This operation is available only if you have a license for the TestComplete Mobile module.

Scripting Analogue

The operation is an analogue of the AndroidDevice.Keys() and iOSDevice.Keys() scripting methods.

Child Operations

The operation cannot have child operations.

Operation Parameters

The operation uses the following parameter:

Keys

String. The text to enter.

For Android devices, you can use special keys like Ctrl or Backspace. For a list of the supported keys, see Keys Action (Android Objects).

To modify the operation’s parameter:

  • Select the operation’s row in the test.

  • Select the Value cell and then click within it or press F2. This will activate the in-place editor.

  • Click the ellipsis button in the in-place editor. This will call the dialog, which is similar to the one described above. In this dialog, you can specify the parameter’s value.

  • Alternatively, to invoke this dialog, simply double-click the operation in the Keyword Test editor.

  • Click OK to close the dialog and apply the changes.

  • Press Enter to confirm the changes and close the in-place editor, or press Esc to close the editor discarding any changes.

Remarks

Before calling this operation, you need to choose a mobile device or a virtual machine that will be the current device (or machine) during testing. To do this, use the Select Device or Device Loop operation.

To input local symbols on Android devices, the Device Keys operation uses the TestComplete Android Agent keyboard. If TestComplete cannot use the Agent keyboard (for instance, if it is disabled or the on-screen keyboard must not be shown), it inputs text by using the virtual keyboard device. The set of key declarations, the key character map file contains, is different on different devices. In most cases, it includes alphanumeric and special characters. For more information on inputting local symbols, see Simulating Local Symbol Input (Legacy).

This operation is asynchronous. This means that TestComplete continues running the test, no matter whether it has finished or not. For more information, see Possible Issues.

For information on testing mobile applications with TestComplete, see the topics of the Testing Mobile Applications section.

See Also

Mobile Category
Device Touch Operation
Simulating User Actions Over Android Devices (Legacy)
Testing Mobile Applications

Highlight search results