TestComplete and Android App Automation (Part-III)
In our last two TestComplete tutorials, we’ve covered the basics of TestComplete and Data-Driven Testing using TestComplete. In today’s tutorial, we’ll delve into a new aspect of TestComplete – automation of Android applications.
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
In this technologically advanced world, smartphones have become integral to our everyday lives. The multitude of devices available, coupled with constant technological updates, makes it a challenging task for developers and testers to guarantee app compatibility.
TestComplete and other similar tools can boost testing coverage and enhance the efficiency of tests. We discussed the fundamental principles of TestComplete in our earlier tutorials.
Today’s tutorial will tackle the following topics:
- The definition of Android
- Necessary software for Android app automation
- Download and installation process for Java on a computer
- Java JDK setup in Windows
- Android SDK Downloading and Installation process
- Setting up Android in Windows
- Configuring Java JDK and Android SDK in TestComplete
- Google USB Drivers Installation
- How to prepare a Mobile Device for testing
- Creation of an Android App Test Project
- Details about the Tested App
- How to record tests using TestComplete
- Analysis of the recorded Test
- Running of the Test
- Error resolution
What You Will Learn:
What is Android?
Originally developed by Android Inc., Google acquired Android in 2005. Android is an open-source operating system primarily created for touchscreen mobile devices like smartphones and tablets. Android is founded on the Linux kernel.
An Android app is a software application operating on the Android platform, which can be a mobile device, tablet, or any other touchscreen-supported device.
Necessary software for automating Android apps
In order to automate Android apps using TestComplete, we must install the required software and adjust TestComplete’s configuration accordingly.
Here’s the required software:
- Java JDK
- Android SDK
- Device USB Drivers
- Android Agent
- TestComplete Mobile Plugins
Now we will guide you through the installation of each of these software components.
Java JDK
1) Downloading and Installing Java on the computer
- You can download the Java JDK through this link
- Once you reach the Java JDK website, click the “Download” button
(Tip: Click on any image to view an enlarged version)
2) Setting up Java JDK in Windows
After we install the Java JDK, it needs configuration within your computer system as well as TestComplete. Here’s how to proceed:
- Right-click on “My Computer” and select “Properties”
- Proceed to “Advanced System Settings”
Android SDK
1) Download and install Android SDK
- Click here to navigate to the Android SDK website
- Scroll to the bottom of the page and click on the download link
2) Configuring Android in Windows
To configure Android in Windows:
- After downloading the Android SDK folder, extract it and copy the files into your local “C” drive
- Open your computer’s details (“My Computer”) and proceed to Advanced system settings
3) Configure Java JDK and Android SDK in TestComplete
Follow these steps if Java JDK and Android SDK aren’t automatically configured in TestComplete, and require manual path setup:
- Go to Tools | Options
- Proceed to Engines | Mobile | Android
- Establish the respective paths for both Java JDK and Android SDK
Google USB Drivers Installation
Here’s how to install Google USB Drivers on Windows:
- Connect your Android device to the computer using a USB
- Proceed to the Device Manager and select Portable Devices
- Right-click on the device name and choose Update Driver Software
- Browse to the folder location C:SDKextrasgoogleusb_driver
- Click Next to initiate driver installation
Preparations for Mobile Device Testing
To carry out Android tests using TestComplete, you need to set up your Android device for testing. Here are the steps:
a) Enable Developer Options on an Android Device
- Navigate to Settings
- Select About Phone/Tablet
- Tap the Build Number 7 times
- Developer Options will be enabled within the Settings menu
Ensure that the following options are enabled in Developer Options:
1) USB Debugging
2) Stay Awake
b) Create an Android App Test Project
Follow these steps to create a test project for Android app automation:
1) Select File → New → Project
2) Enter a name for your project and click Next
3) Choose Android Applications and click Next
4) Add your Android application to the project
5) Select the scripting language and click Finish
About Tested App
For this guide, we utilized a sample Android application given by SmartBear along with TestComplete. The application is constructed for managing orders, enabling users to form, edit, and remove purchase orders.
The application under test should be installed on the device chosen for automated testing.
How to record a test in TestComplete?
To record a test in TestComplete:
1) Click on “Append to Test”
2) A recording panel will show up to signify that the test recording has begun
3) Execute the actions in the Android app that you wish to record
4) Click on “Stop Recording” to end the recording
Analysis of Recorded Test
After stopping the recording, the keywords produced during the recording session will be displayed in the keyword editor. Each keyword corresponds to an action executed in the Android app.
Executing the Test
To execute the previously-recorded test:
1) Click on the “Run Test” button
2) After the test execution concludes, the test log will be compiled and displayed
Fixing Errors
If the test execution fails, these are some potential culprits to consider:
1) Third-party apps overlapping with the app screen
2) The initial conditions of the test might be wrong
3) Java JDK and Android SDK might not be correctly configured in TestComplete
4) Device USB drivers may be malfunctioning or incorrectly installed
5) There may be a mismatch between the versions of the SDK and the Android device
6) Incompatibility between TestComplete and Android versions
Concluding Thoughts
This tutorial served as an introduction to TestComplete and the ways it can be utilized for Android app automation. TestComplete offers a plethora of features which can be used to automate complex systems and frameworks, ensuring effective test coverage.
We trust that you found this series of TestComplete tutorials enlightening and useful. Our subsequent article will delve into Robotium – The Most Prominent Android Application UI Testing Tool.