
Introduction
The article demonstrates android testing fundamentals in Katalon Studio. The Application Under Test (AUT) is the APIDemos.apk application. Before beginning, the article let us understand the terms mobile testing and Katalon. Mobile application testing is the process through which applications are tested for required quality, functionality, compatibility, usability, performance, and other characteristics.
Katalon test-ops is a web-based application that gives dynamic perspectives and insight into your automation testing data. You can use your automation testing data by transforming and visualizing your data, analyzing test results; seamlessly integrating with tools like Katalon Studio and Jira; maximizing the testing capacity with remote execution.

Open the sample Android test project
To start the Android sample project, in Katalon Studio, click on File > New Sample Project > Sample Android Mobile Tests Project. Katalon Studio shall automatically detect and prompt you to install Android SDK if your current machine is not having it or your Android SDK is not present at the default folder: ~/.katalon/tools/android_sdk.

Android sample project components
Profiles
To open the execution profile, click on Profiles > default.

You can save and create all global variables in the execution profile. They can be used across test cases in your project.
Katalon creates 4 global variables in this sample project, as shown:

Test cases
To access test cases in this project, move to the Test Cases folder in the Test Explorer panel.

There are two test cases for different purposes:
-
The test case Verify Correct Alarm Message is to check if we can get the right displayed message. The flow in this test case is as given:
-
Open the APIDemos.apk application. Here, the location of the Application Under Test (AUT) is under the <sample-project-folder>/androidapp folder. We use the given sample code to get the absolute path to the application:
-
Open the APIDemos.apk application. Here, the location of the Application Under Test (AUT) is under the <sample-project-folder>/androidapp folder. We use the given sample code to get the absolute path to the application:
/*Get full directory's path of android application*/
def appPath = PathUtil.relativeToAbsolutePath(GlobalVariable.G_AndroidApp, RunConfiguration.getProjectDir())
/*Start the Application Under Test - AUT*/
Mobile.startApplication(appPath, false)
- Tap App. We set the timeout for 10 seconds.
- Tap Activity. We set the timeout for 10 seconds.
- Tap Custom Dialog. We set the timeout for 10 seconds.
-
Verify if the text displayed on the App/Activity/Custom Dialog dialog is correct.
2. The test case Verify Last Items In List is to check whether we can identify the last correct item in the list.
Start the APIDemos.apk application. Here, the Application Under Test (AUT) location is inside the <sample-project-folder>/androidapp folder. We use the below sample code to identify the absolute path to the application:
/*Get full directory path of the android application*/
def appPath = PathUtil.relativeToAbsolutePath(GlobalVariable.G_AndroidApp, RunConfiguration.getProjectDir())
/*Start the Application Under Test -AUT*/
Mobile.startApplication(appPath, false)
- Click Graphics. We utilize the G_Timeout global variable as the timeout value.
- Scrol down to Xfermodes item.
- Make sure if the current screen should show Xfermodes text after scrolling
Test suite
For accessing the test suite in this project, in the Test Explorer panel, move to the Test Suites > Regression Tests folder. This test suite combines the 2 test cases shown above.

Execute selected test case or test suite
To execute a test case or a test suite in the sample project:
- Select the test case/test suite you want to execute.
- On the main toolbar, select Android as the device type in the dropdown list next to Run

- Select your device from the Android Devices list. Click OK.

- Observe the test result in the Log Viewer tab.

Frequently Asked Questions
Differentiate between the Manual and Script view in Katalon.
The Manual view allows a user to use basic keyword-driven configuration to create automated tests without writing code. The Script view is mostly used by advanced users or programmers who can modify and write test scripts using Groovy or Java.
Does Katalon support BDD?
Along with the original built-in keywords, Katalon Studio supports Cucumber keywords.
Does Katalon support Java?
To operate a Katalon Studio instance and create test applications, Katalon Studio uses the standard embedded Java Runtime Environment (JRE) version 8.




