Preparing Android Applications (Legacy)

Applies to TestComplete 14.93, last modified on September 21, 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.

Since the 14.70 version, TestComplete instruments Android applications automatically when running them from the Tested Applications collection.

To expose “native” methods, properties, and fields of Android controls to TestComplete, you need to instrument your Android application (that is, prepare it for testing). We call instrumented Android applications white-box or Android Open Applications as they are “open” to TestComplete.

Instrumentation means running an Android application with the special PatchServices.jar library injected. Android applications can be instrumented automatically or manually.

Automatic Instrumentation

TestComplete automatically instruments Android applications added to the Tested Applications collection of your project. It instruments them automatically when you run these applications from your test or from the TestComplete UI.

To add an application to the Tested Applications collection, use the TestedApps editor or the TestedApps.AddAndroidApp(…) method.

During the instrumentation, TestComplete does not change the application’s source or binary code. So, you do not need to create a separate build configuration for testing, you can use your “production” configuration, for example.

Manual Instrumentation

Alternatively, you can do all the preparation actions manually in the Eclipse IDE or Android Studio. Follow these links for detailed information:

Do not submit instrumented in such way applications to Google Play. Applications use private APIs and will be rejected. Create a separate build configuration for test builds.

Other Preparatory Actions

To test Android applications with TestComplete, you should also prepare the computer where TestComplete is running and prepare your Android device, emulator, or virtual machine. For complete information on this, see the topics of the following section:

See Also

Testing Android Applications (Legacy)

Highlight search results