Introduction
We all must agree that testing is integral to developing web applications. It informs us whether the task is performing as per our expectations before it is launched.
Katalon, a platform for Automation Testing, is used to test web applications, APIs, and mobile and desktop applications. It is a powerful automation tool designed to generate and reuse automated test scripts for the User Interface without any need to code.

What is Katalon Studio?
Katalon Studio is a closed-source automation testing platform for web, application, and API testing. It was in 2015 for internal testing. Later, in 2016, it was released to the public.
We can create, execute, or view our reports for test automation using Katalon Studio. You require no special skills to use the Katalon Studio. It offers both the manual view and the script view. It is helpful to anyone who wants to test their software irrespective. of their experience in programming.
Features of Katalon Studio
Various special features of Katalon Studio have led to its popularity. Some prominent features are mentioned below.
- The Katalon Studio covers everything a tester needs in a single and organized package. This makes its deployment very easy.
- The Katalon Studio is simple to install with no tedious processes involved.
- As mentioned above, it is not compulsory for you to require any specific specialized skill to work with Katalon Studio.
- You can complete every stage, from organizing the project, creating the tests, and running the tests, to producing the final report using in-built example copies and giving a few instructions. This helps you achieve faster results.
In detail, this article will discuss the process of Handling Alert Dialog in Mobile App with Katalon Studio. So, without further ado, let’s start.
Handling Alert Dialog in Mobile App with Katalon Studio
An Alert Dialog box is used to send alert messages to the user. It consists of a specific message to be given to the user, and two options, Ok or Cancel, to accept or reject the message respectively. This module explains the process of Handling Alert Dialog in Mobile App with Katalon Studio using examples and relevant images.
There are two ways to perform multi-touch actions in Mobile App with Katalon Studio- Manual Mode and Script Mode.
Login Scenario
We have used a sample application to learn the process. You can use this same application or go for a different one. If you want to use the same application, open this link. Select the application and open Alert Dialogs.
The screenshot below shows an example of an Alert Dialog. We aim to handle the dialog that generally appears on a mobile application if it detects any suspicious or dangerous activity.

Manual Mode
This is the first way for Handling Alert Dialog in Mobile App with Katalon Studio. To complete the process accurately, follow these steps properly.
1. Start the Application and click on Input to open a window. The image below shows the window that appears.

2. Carefully understand the available parameters, their type, and their value type. Figure out what values you can pass.
3. Click Ok.
4. A screen appears where you will have to add the required number of items. The image below shows the screen that appears. These items influence your experience while Handling Alert Dialog in Mobile App with Katalon Studio.
A new test case screen looks like this.

5. Now, add a few items, as shown in the image below. Carefully pass the required Objects, Inputs, and descriptions.

6. Call Scroll to Text method and pass the input as ‘Alert Dialogs’.
7. Check if any App or Alert Dialogs are present using the Wait for Element Present keyword and verify it using Verify Element Visible method.
8. Again, call Scroll to Text method and pass the input as ‘Ok Cancel dialog with traditional theme’.
9. Use the Tap method to pass the object ‘Ok Cancel dialog with traditional theme’.
10. Check for the element present using Wait for Element Present keyword and verify it using Verify Element Visible method.
11. After successfully adding the element above, you will see a screen like this.

12. Call the Get Text method to capture the text of Alert Dialog. After capturing, store it in a variable name actual_AlertText.
13. Now match the expected and original values using Verify Match method.
14, Call the Tap method and pass input as ‘Ok’.
15. Close the application.
Script Mode
This is the second way for Handling Alert Dialog in Mobile App with Katalon Studio. Enter the code below in the editor to proceed.
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Demo
import com.kms.katalon.core.model.FailureHandling as FailureHandling
'Path of the Apk File Store in path variable.'
def path = RunConfiguration.getProjectDir() + '/Data Files/ApiDemos.apk'
'Starting the application.'
Demo.startApplication(path, false)
'Waiting for element Present of Heading API Demos.'
Demo.waitForElementPresent(findTestObject('API Demos Objects/Article_4/heading_API_Demos'), 50)
'Scroll to App text'
Demo.scrollToText('App', FailureHandling.STOP_ON_FAILURE)
'Tap on App'
Demo.tap(findTestObject('API Demos Objects/Handle Alert/text_App'), 25)
'Scroll to Alert Dialogs text'
Demo.scrollToText('Alert Dialogs', FailureHandling.STOP_ON_FAILURE)
'Tap on Alert Dialogs'
Demo.tap(findTestObject('API Demos Objects/Handle Alert/text_Alert Dialogs'), 35)
'Wait for Element Present of Header Alert'
Demo.waitForElementPresent(findTestObject('API Demos Objects/Handle Alert/text_Header Alert'), 35)
'Verify Element Visible of Header Alert'
Demo.verifyElementVisible(findTestObject('API Demos Objects/Handle Alert/text_Header Alert'), 35)
'Scroll to "OK Cancel dialog with traditional theme"'
Demo.scrollToText('OK Cancel dialog with traditional theme', FailureHandling.STOP_ON_FAILURE)
'Tap On Button OK Cancel dialog with traditional theme'
Demo.tap(findTestObject('API Demos Objects/Handle Alert/button_OK Cancel dialog with traditional theme'), 35)
'Wait for Element Visible of Alert Title'
Demo.waitForElementPresent(findTestObject('API Demos Objects/Handle Alert/text_Alert Title'), 35)
'Verify the Element Visible of Alert Title'
Demo.verifyElementVisible(findTestObject('API Demos Objects/Handle Alert/text_Alert Title'), 35)
'Get the Alert Title text and Store in to "actual_AlertText" variable'
actual_AlertText = Mobile.getText(findTestObject('API Demos Objects/Handle Alert/text_Alert Title'), 30)
'Verify the actual and Expected Alert Texts'
Demo.verifyMatch(actual_AlertText, "Lorem ipsum dolor sit aie consectetur adipiscing\nPlloaso mako nuto siwuf cakso dodtos anr koop.",false)
'Tap on OK Button on Alert'
Demo.tap(findTestObject('API Demos Objects/Handle Alert/button_OK'), 35)



