|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 Android tests with TestComplete, you need to prepare your Android device for testing. This topic provides detailed information on preparing physical devices. For information on setting up Android virtual machines and emulators, see Preparing Android Virtual Machines for Testing (Legacy) and Preparing Android Emulator for Testing (Legacy).
In this topic:
• 1. Enable Developer Options on the Device
• 2. Install the Device USB Drivers
• 3. Disable Manufacturer’s Synchronization Software
• 4. Install TestComplete Android Agent
TestComplete works with Android applications via the Android Debug Bridge (ADB) which is part of Android SDK. You need to download and install this SDK on your TestComplete computer (see Preparing Test Computers and TestComplete for Android Testing (Legacy)).
The main goal of preparatory actions is to make ADB “see” your Android device. The steps described in this topic work for most devices. However, certain devices may require additional actions. For more information on them, read documentation on developing applications for your device.
TestComplete can work with physical Android devices that are connected to your computer via a USB cable or Wi-Fi.
1. Enable Developer Options on the Device
To perform testing on a physical Android device, you need to enable certain developer options on the device:
Make the developer options visible. Go to Settings > About phone/tablet and touch Build number 7 times.
Note: The way in which you make the developer options visible may vary between devices and Android versions. Please, refer to the documentation on your device for more information.
Go to Settings > Developer options and enable the following options:
USB debugging - Enables communication between the device and Android Debug Bridge (ADB). In other words, it makes your device visible to ADB and TestComplete.
Stay awake - Prevents the device from going into sleep mode during debugging.
For Xiaomi users: If your Xiaomi device has the USB Debugging (security settings) and Install via USB options, you must enable the options. To do this, you need an active Mi account, and a SIM card must be inserted into the device.
Save the changes.
2. Install the Device USB Drivers
In order for ADB to be able to see your Android device, you need to install the device USB drivers on your computer. If you installed the software provided by the device manufacturer (for example, a data synchronization tool), the driver may have already been installed on your computer. If you are not sure about this, please install (or reinstall) the drivers from the manufacturer's web site. For instructions and driver download links, see OEM USB Drivers in the Android documentation:
To ensure the device driver is installed properly, connect your device to the computer via USB and open the Control Panel | Device Manager applet on the computer. Your device should be listed under the Portable Devices node there. It can also be listed as a top-level node with the word Android in its name, for example, Android USB devices, SAMSUNG Android Phones, ASUS Android Devices and so on. If the device is listed under some other name or has an error, warning or question icon, reinstall the device driver using the link above.
3. Disable Manufacturer’s Synchronization Software
Some device manufacturers provide software for synchronizing data between the device and PC. Some of this software, for example, HTC Sync Manager, include a custom version of Android Debug Bridge (adb.exe) that may conflict with the version that is included in the Android SDK and is used by TestComplete.
To perform Android testing, you need to close any non-standard ADB processes and disable (or uninstall) manufacturer services that include non-standard ADB.
4. 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.
Installation of the Android Agent is also recommended for black-box testing, as it is needed for simulating keystrokes and simplifies testing geolocation activities.
For information on installing the Agent, see the Agent description.
|Requirement: In order for the Android Agent to be able to work on a device, the device must have 512 MB of RAM or more.|
5. Disable Certain Settings on the Device
Some devices can support the Air view and Palm motion features. If your test device supports these features, and if you are going to record gestures (multi-touch events) on this device, we recommend that you disable these features before recording.
You disable the features in the device’s Settings menu. The path to the features in the menu can vary from one device to another. To learn where these features are located in the menu, see the device’s documentation. Below are examples for two popular Samsung smartphones:
Samsung Galaxy S4
- Settings » My device » Air view
- Settings » My device » Motions and gestures » Palm motion
Samsung Galaxy Note 3
- Settings » Controls » Air view
- Settings » Controls » Palm motion
Android devices 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 device is running under Android OS version 4.0 - 4.1:
- On your Android device, go to Google Settings and disable the Verify apps option.
If your device is running under Android OS version 4.2 or later:
On your Android, device 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 device, 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 device.|
Other Preparatory Actions
Besides preparing Android devices for testing, you 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 application for TestComplete and test it as an Open Application. For complete information, see Preparing Android Applications (Legacy).
Testing Android Applications (Legacy)
About Testing Android Applications (Legacy)