Preparing Android Virtual Machines for Testing (Legacy)

Applies to TestComplete 15.64, last modified on May 16, 2024
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.

To create and run TestComplete tests for Android applications working on Android-x86 virtual machines, you need to prepare these virtual machine for testing. This topic provides detailed information on preparatory actions.

In this topic:

General Idea

TestComplete works with Android devices and virtual machines via Android Debug Bridge (ADB) which is part of the Android SDK. You need to download and install this SDK on your TestComplete computer (see Preparing Test Computers and TestComplete for Android Testing (Legacy)).

To prepare an Android virtual machine for testing, you need to connect the virtual machine to Android Debug Bridge and then install TestComplete Android Agent on the machine.

The main goal of these actions is to make Android Debug Bridge “see” your Android virtual machine.

Preparatory Steps

1. Emulate Network Adapter

To test applications running on Android virtual machines, these virtual machines must emulate a network adapter and be available via the network to your TestComplete computer.

For detailed information on configuring network parameters, see documentation on virtual machines you use.

2. Connect Virtual Machine to Android Debug Bridge

Important: You need to connect your Android virtual machine to the Android Debug Bridge in order for TestComplete to be able to work with this virtual machine. Connection is required for both test recording and running.

To connect, you need to determine the IP address of the machine and pass it to the adb connect command. For detailed information, see Connecting TestComplete to Android Devices (Legacy).

You need to set up a connection for the virtual machine after it starts. When you have established a connection, you can use it until it is broken, that is, until the virtual machine is off, or until the ADB executable restarts, or until the user session in the operating system is over.

3. Install TestComplete Android Agent

If you are going to test your Android application as an Open Application, the TestComplete Android Agent must be installed on your device.

TestComplete installs the Android Agent on your device automatically when you first connect to it.

For information on installing the Agent, see the Agent description.

Requirement: In order for the Android Agent to be able to work on a virtual machine, the machine must have 512 MB of RAM or more.

4. Disable Certain Settings on the Virtual Machine (Optional)

Android devices (both physical and virtual) have a number of security settings aimed at protecting your device from potentially harmful applications. If you experience issues with installing your tested Android applications on your device from TestComplete, consider configuring the following settings:

If your virtual machine is running under Android OS version 4.0 - 4.1:

  • On your Android virtual machine, go to Google Settings and disable the Verify apps option.

If your virtual machine is running under Android OS version 4.2 or later:

  • On your Android, virtual machine do the following:

    • Go to Settings | Security and disable the Verify apps option.

    -- or --

    • Go to Settings | Developer options and disable the Verify apps over USB option.

You may also need to allow installing applications from unknown sources:

  • On your Android virtual machine, go to Settings | Security (or Settings | Applications) and enable the Unknown sources option.

Configuring the settings as described above may reduce the security of your Android virtual machine.

Other Preparatory Actions

Besides preparing Android virtual machines for testing, you also need to configure TestComplete. For detailed information on this, see Preparing Test Computers and TestComplete for Android Testing (Legacy).

Also, it is recommended to prepare your Android application for testing and test it as an Open Application. For complete information, see Preparing Android Applications (Legacy).

See Also

Testing Android Applications (Legacy)
About Testing Android Applications (Legacy)

Highlight search results