About TestComplete Android Agent Keyboard (Legacy)

Applies to TestComplete 15.0, last modified on November 17, 2021
The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach.

TestComplete Android Agent includes the TestComplete Android Agent keyboard. If this keyboard is active, a tested Android device does not show its onscreen keyboard when text boxes get focus. Instead, it uses the invisible onscreen Agent keyboard for the text input.

You can make the TestComplete Android Agent keyboard a default keyboard on your device, or activate it from your test before running the test commands that need it and deactivate it after this.

Installing the Agent Keyboard

The TestComplete Android Agent keyboard is installed when TestComplete installs the Android Agent on your device. See About TestComplete Android Agent (Legacy).

When to Use the Agent Keyboard

We recommend that you use the Agent keyboard:

Setting the Agent Keyboard as the Default Keyboard

To make the TestComplete Android Agent keyboard the default keyboard on your test device:

  1. Install the TestComplete Android Agent application on the device, if it is not installed yet.

  2. Open the Agent.

  3. Select Enable the Android Agent Keyboard.

    Note: Android 5.1.1 (and later) asks for your confirmation to use the new keyboard (the input method). Select OK to confirm.
  4. Select TestComplete Android Agent in the Keyboard & Input Methods section. Select OK in the subsequent window and press Back.

  5. Select Make the Agent Keyboard Default.

  6. Select the multilingual keyboard emulator. The dialog will close automatically.

  7. Exit the Agent application by pressing Back or Home.

Activating and Deactivating the Agent Keyboard From Tests

To enable the Agent keyboard from your test:

JavaScript, JScript

// Enable the Agent keyboard
Mobile.Device().ShellExecute("ime enable com.smartbear.androidagent/.keyboard.KeyboardEmulator");
Mobile.Device().ShellExecute("ime set com.smartbear.androidagent/.keyboard.KeyboardEmulator");

Python

# Enable the Agent keyboard
Mobile.Device().ShellExecute("ime enable com.smartbear.androidagent/.keyboard.KeyboardEmulator");
Mobile.Device().ShellExecute("ime set com.smartbear.androidagent/.keyboard.KeyboardEmulator");

VBScript

' Enable the Agent keyboard
Call Mobile.Device().ShellExecute("ime enable com.smartbear.androidagent/.keyboard.KeyboardEmulator")
Call Mobile.Device().ShellExecute("ime set com.smartbear.androidagent/.keyboard.KeyboardEmulator")

DelphiScript

// Enable the Agent keyboard
Mobile.Device().ShellExecute('ime enable com.smartbear.androidagent/.keyboard.KeyboardEmulator');
Mobile.Device().ShellExecute('ime set com.smartbear.androidagent/.keyboard.KeyboardEmulator');

C++Script, C#Script

// Enable the Agent keyboard
Mobile["Device"]()["ShellExecute"]("ime enable com.smartbear.androidagent/.keyboard.KeyboardEmulator");
Mobile["Device"]()["ShellExecute"]("ime set com.smartbear.androidagent/.keyboard.KeyboardEmulator");

To disable the Agent keyboard, use this code:

JavaScript, JScript

// Disable the Agent keyboard
Mobile.Device().ShellExecute("ime disable com.smartbear.androidagent/.keyboard.KeyboardEmulator");

Python

# Disable the Agent keyboard
Mobile.Device().ShellExecute("ime disable com.smartbear.androidagent/.keyboard.KeyboardEmulator");

VBScript

' Disable the Agent keyboard
Call Mobile.Device().ShellExecute("ime disable com.smartbear.androidagent/.keyboard.KeyboardEmulator")

DelphiScript

// Disable the Agent keyboard
Mobile.Device().ShellExecute('ime disable com.smartbear.androidagent/.keyboard.KeyboardEmulator');

C++Script, C#Script

// Disable the Agent keyboard
Mobile["Device"]()["ShellExecute"]("ime disable com.smartbear.androidagent/.keyboard.KeyboardEmulator");

See Also

About TestComplete Android Agent (Legacy)
Simulating Text Input on Android Devices (Legacy)
Simulating Text Input in Android Open Applications (Legacy)

Highlight search results