Preparing Test Computers and TestExecute for Android Testing

Applies to TestExecute 15.0, last modified on October 12, 2021

Before you start running tests on Android devices, you need to set up TestExecute and your mobile device.

1. Install JDK

To test Android applications, you need to have Java Runtime Environment or Java Development Kit (JRE or JDK) ver. 8 and later installed on the computer where TestExecute is installed. You can download it from –

http://java.com/en/download/windows_manual.jsp

Note: You can use any supported versions of Java SE Runtime Environment (JRE) or Java SE Development Kit (JDK). However, the preferable version is 8.

For testing, it is enough to have JRE installed, but you may need to download and install JDK, as JDK includes JRE modules.

If you use a 64-bit version of Windows, you can use both the 32-bit and 64-bit Java versions.

If using the 64-bit Java version is not critical for you, we recommend installing the 32-bit Java version. Some packages of the Android SDK (that should also be installed on your test machine, see below) work with 32-bit Java.

After you install JDK, you need to specify the path to it in TestExecute settings (see below).

2. Install the Android SDK

TestExecute uses the following modules of the Android SDK:

  • Android Debug Bridge (ADB, adb.exe) - To communicate with Android devices.

  • Android Asset Packaging Tool (aapt.exe) - To work with packages.

You need to have the Android SDK installed on each computer where you are going to run mobile tests.

You can get the Android SDK from the Android Developer web site:

https://developer.android.com/sdk/index.html

Android Studio (Default Download)

You can download the Android SDK along with Android Studio:

https://developer.android.com/studio/index.html

  1. Click Download Android Studio to download an installer that contains both the SDK files and Android Studio needed for Android application development:

    Downloading Android Studio

    Click the image to enlarge it.

  2. Follow the installation instructions on the Android Studio web site.

  3. After the studio is installed, launch it and select Configure > SDK Manager, or select File > Settings and then select Appearance & Behavior > System Settings > Android SDK:

    Opening Android ADK Manager

    Click the image to enlarge it.

  4. In the SDK Manager, make sure the following items are selected:

    The SDK Platforms tab

    • Android 10.x

    The SDK Tools tab

    • Android SDK Platform-tools

    • Android SDK Build-tools ver. 26.0.2 or later

    • If you are going to test on Google Nexus devices: Google USB Driver

    • If you are going to use Android emulator for testing:

      Intel x86 Atom System Image for Android 4.0.3 (API 15) or later

      Intel x86 Emulator Accelerator (HAXM)

    Android SDK Manager: The SDK Platforms tab

    Click the image to enlarge it.

    Android SDK Manager: The SDK Tools tab

    Click the image to enlarge it.

  5. Click OK to install packages, if needed. Accept the license agreement and proceed with the installation.

After you install Android Studio and all the needed packages, specify the path to the SDK files in TestExecute settings. Usually, the path is <AppData>\Local\Android\Sdk. See below.

SDK Tools

You can download and install the SDK platform tools only:

You need to have the 32-bit version of Java JRE or JDK installed on your computer.

  1. In your web browser, navigate to the Downloads page of the Android Developer web site:

    https://developer.android.com/studio/index.html#downloads

    Scroll to the Command line tools only section:

    Downloading Android ADK Platform tools

    Click the image to enlarge it.

  2. Locate the SDK tools package named sdk-tools-windows-NNN.zip and download it.

  3. Extract the packed files to a folder on your computer.

  4. Find the sdkmanager utility in the folder where the extracted files are located. Usually, it resides in the <sdk-tools-windows-NNN>/tools/bin folder.

  5. Use the utility to install the following items:

    • Android 10.x (on the SDK Platforms tab)

    • Android SDK Platform-tools

    • Android SDK Build-tools ver. 26.0.2 or later

    • If you are going to test on Google Nexus devices, Google USB Driver

    • If you are going to use Android emulator for testing:

      Intel x86 Atom System Image for Android 4.0.3 (API 15) or later

      Intel x86 Emulator Accelerator (HAXM)

    To do this, run the utility with the following command-line parameters:

    sdkmanager "platform-tools" "platforms;android-NN" "build-tools;NN.N.N" "extras;google;usb_driver" "emulator" "system-images;android-NN;default;x86"

    Where NN is the version of the API for which you want to install the SDK tools.

    For detailed information on the sdkmanager utility command-line parameters, see the utility description on the Android Developer web site.

  6. Specify the path to the Android SDK in TestExecute settings (see below).

3. Enable USB Support in TestExecute Virtual Machine

TestExecute can run on virtual machines. If you are using a physical mobile device for testing, the TestExecute virtual machine needs USB support to be able to access physical devices connected to the host computer. For instructions on how to enable USB support in a virtual machine, refer to the virtual machine’s documentation.

Applications typically run slower on virtual machines than on physical machines. To use TestExecute on a virtual machine, make sure your host configuration provides the highest virtual machine performance possible. If you experience performance issues, use more powerful host hardware.

4. Install Device USB Drivers

TestExecute can automate tests on physical mobile devices that are connected to the computer via USB cable. For that you need to install the device USB driver on the TestExecute computer:

  1. In the Get OEM drivers table in the Android documentation, find the USB driver that is appropriate for your mobile device:

    https://developer.android.com/studio/run/oem-usb.html#Drivers

    Note: If you are using a Google Nexus device, use the Google USB driver.
  2. Download the needed driver from the vendor's web site.

  3. Follow the instructions in the Android documentation to install the driver:

    https://developer.android.com/studio/run/oem-usb.html

To check whether the needed driver is installed and functions properly, you can use the Android Debug Bridge utility:

  1. Connect your Android device to your computer via a USB cable.

  2. Command the Android Debug Bridge utility to list the devices connected to your computer:

    adb devices
  3. If the utility detects your device correctly and shows its serial number, the driver is installed and functions properly.

5. Specify Android SDK and Java Paths in TestExecute Settings

Before you start running mobile tests, specify the Android SDK and Java paths in TestExecute.

When you install TestExecute, the installation program tries to find these paths automatically on your computer. If it is unable to do so, you may need to specify these paths in TestExecute manually:

Specify paths to Android SDK and Java in TestExecute

Click the image to enlarge it.

  1. To invoke the dialog, right-click the TestExecute icon ( ) in the notification area (tray) and then click Options. This will open the Options dialog.

  2. On the left of the dialog, select the Engines > Mobile > Android category.

  3. In the Path to Android SDK edit box, specify the folder where you installed the Android SDK on your computer. For example, C:\Android SDK.

  4. In the Path to Java Runtime edit box, specify the folder where Java is installed on your computer. For example, C:\Program Files\Java\jre8.

  5. Click OK to close the dialog and save the settings.

6. Close Other TestExecute and TestComplete Instances

When testing Android applications, do not run TestExecute and TestComplete at the same time on a computer (in the same Windows session, or in different sessions in Windows Server editions). Otherwise, the two Android testing engines will conflict and cause unexpected behavior.

Other Preparatory Actions

After you prepare TestExecute for testing, you need to check the settings of your mobile device and of the application under test. For details on preparing for Android testing, see the TestComplete documentation.

See Also

Preparing for Running Tests on Android Devices

Highlight search results