
Introduction
By parameterizing the test objects, we can dynamically update the test objects’ locators by using either global or local variables. Katalon Studio aids in parameterizing the properties of test objects to handle dynamic things.
Katalon Studio furnishes an image locator method to identify Test Objects with images. Image-based testing for Mobile in Katalon Studio depends on Appium's finding image objects.
Parameterized Mobile test object properties
The advantage of parameterizing mobile test objects is similar to that of web test objects.
To parameterize test objects in Mobile testing
-
Open a sample project of testing on Android devices by
- going to File
- New Sample Project
-
Sample Android Mobile Tests Project
-
Then go to Object Repository/Application/android.widget.TextView -App in the test explorer
- Open the test object view of the android.widget.TextView - App whose properties will be parametrized.
In this article, we are going to use the example where we find out an object that has “ [(text() = 'demokatalon' or . = 'demokatalon')] ” as its selector. The steps to apply this feature are as follows:
-
Parameterizing the test object’s dynamic property.
-
Create a property whose value is a variable with the following syntax: ${Variable_name}. For our example, in the Object's Properties panel, we add an object's property with:
- Name: text
- Value: ${text}
- The selector locator is generated as follows:
- //*[(text() = '${text}' or . = '${text}')]
- And gets identified at runtime by passing data.

Source: Katalon
3. Using the parameterized test object in a test case
In Manual view
Inside the Verify Correct Alarm Message test case, double-click on the test object that contains the parameterized property i.e., android.widget.TextView - App.
In the variables panel, we add new variables with the following properties:
- Param Type: Type of the variable (Default type being a string)
- Param: The variable name was given to the property created in step 1.
- Value Type: It is the type of the variable’s value.
- Value: A particular value to the variable.

Source: Katalon
In Script View
We also can switch to the Scripting Mode of the ongoing Test Case to adjust the property's value at any time. The determining variable is automatically mapped when we select a mobile object from the manual mode and hence doesn’t need to be defined again manually.
Call the findTestObject method within a keyword:
In our example, the tap keyword is performed on our test object with the text value as the one that we have just specified.
Escaping special characters
To be able to use special characters like ‘ \ ’or $ as normal characters in any place that is using parameterized test objects, we prepend it with a backslash ( \ ) or escape character.
Example:
{
"productName": ${GlobalVariable.productName},
"unit": "\\bottle\",
"quantity": 50,
"discount": ${ if (productName == "wine") { return 30 } else { return 0}}
"note": "Currency unit of ${GlobalVariable.productName} is \$."
}
Without ‘ \ ' Currency unit of ${GlobalVariable.productName} is $.
With ‘ \ ’ Currency unit of wine is $.
Image-based Testing
Commencing with version 7.2, image-based testing has been available for Katalon Studio enterprise users.
Image-based testing allows us to interact with Mobile objects and locate them by their images. It is especially helpful in the following use cases:
- Objects in a canvas of a 2D or 3D game.
- Dynamic test objects with no unique selectors.
Image-based testing for Mobile in Katalon Studio depends on Appium's finding image objects. Katalon Studio will automatically encode images to Base64 for reference during test execution.






