Table of contents
1.
Introduction
2.
Open the sample Android test project​
3.
Android sample project components​
3.1.
Profiles​
3.2.
Test cases​
3.3.
Test suite​
4.
Execute selected test case or test suite​
5.
Frequently Asked Questions
5.1.
Differentiate between the Manual and Script view in Katalon.
5.2.
Does Katalon support BDD?
5.3.
Does Katalon support Java?
6.
Conclusion
Last Updated: Mar 27, 2024

Sample Android mobile tests project in Katalon Studio

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?
OG image

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.

intro pic

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.

Open Android sample project

Android sample project components

Profiles

To open the execution profile, click on Profiles > default.

Open execution profile in the sample Android project

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:

table 1.png

Test cases

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

Sample test cases


There are two test cases for different purposes:

  1. 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:
       
/*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.

Test Suites

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
Execute the selected test
  • Select your device from the Android Devices list. Click OK.
Select the Android device
  • Observe the test result in the Log Viewer tab.
View results

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.

Conclusion

We have extensively discussed the Sample Android mobile tests project in Katalon Studio.

We hope this blog has helped you enhance your knowledge. If you would like to learn more. Check out our articles on Advanced Guides in Katalon. Practice makes a man perfect. To practice and improve yourself in the interview. You can check out the Top 100 SQL problems and Interview experienceCoding interview questions and the Ultimate guide path for interviews.

Live masterclass