Skip to main content

Manage Mobile Test Objects in Katalon Studio

Create a Mobile Object

We recommend creating a Mobile object by using Katalon Mobile Spy since the object locators are captured automatically for detecting objects during test execution.

You can also create an object in Object Repository by right-click on Object Repository and selecting New > Mobile Object.



The most important property of an object is its locator strategy and value. The locator should be unique in detecting that object. Select a locator strategy among the provided option and enter a locator.

Katalon Studio fully supports Appium selector strategies except for Android Data Matcher. See Locator strategies for Mobile objects.



Validate Test Object on AUT

You can add test objects to Mobile Object Spy to verify if the object can be detected successfully in the application under test. Refer to Spy Mobile Utility for more details regarding how to validate captured objects against the application under test.

To add an object to Mobile Object Spy, right-click on the item to open its context menu and select the option.



Add an object property

You can add multiple object properties to the Object's Properties table. Please note that object properties cannot share the same name in an object.

  1. In the Object's Properties panel, click Add.
  2. In the displayed Add property dialog, specify the required information:
  • Name: The object property's name. You can select one of the provided options (class, css, id, name, title, xpath) or enter a name manually.
  • Match condition: The condition is used for detecting the target object during execution.
  • Value: The value that completes a match condition.

The new property is added to the properties list as configured above. You can also change the properties' values here.

In Script View

Script View allows defining and handling Test Objects programmatically. The following is a usage example demonstrating how to do that:



import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.testobject.MobileTestObject
import com.kms.katalon.core.testobject.MobileTestObject.MobileLocatorStrategy

// Find an object which was defined already in Object Repository
myPredefinedObject = findTestObject('android.widget.TextView - App')

// Create a new mobile object programmatically
MobileTestObject mobileTestObject = new MobileTestObject("TestObjectID")
mobileTestObject.setMobileLocatorStrategy(MobileLocatorStrategy.XPATH)
mobileTestObject.setMobileLocator("//android.widget.TextView[(text() = 'App' or . = 'App')]")