To test non-instrumented Android applications, for example, built-in Android applications, or applications that you cannot instrument, you can use image-based tests. In image-based tests, TestComplete identifies Android UI elements by their images rather than by object properties.
To learn more about image-based tests in TestComplete, see Image-Based Testing.
The easiest way to create an image-based test for an Android application is to record it:
Connect your Android device to TestComplete.
In TestComplete, open the Mobile Screen window. You record Android tests in the Mobile Screen window rather than on the device itself.
Work with your tested application through the Mobile Screen window.
If your application is not instrumented, for each control with which you interact, TestComplete will do the following —
TestComplete will capture the image of the control with which you interact.
To determine the control’s borders, TestComplete uses accessibility information it extracts from your non-instrumented Android application.
TestComplete will save the image to the Image Repository and generate the image name based on the accessibility information it retrieves from the control.
It will record a test command using the captured image as a target.
After the recording is over, you can view and edit the recorded actions.
A sample test looks like this:
When TestComplete records user actions over composite controls (for example, date-time pickers, table views or expandable lists), it captures the exact touch point coordinates. It records actions over simple controls (like buttons or check boxes) without coordinates. During the test runs, TestComplete will simulate user actions over simple controls at the center of their recognition area.
For controls whose images you store in your project’s Image Repository, you can specify whether TestComplete should treat them as composite:
Open the Image Repository and select the needed item in the Image Set.
Select the Composite control check box: