Hello everyone,
I’m currently facing an issue when automating my mobile app testing with Katalon Studio. I use the following XPath format for all input fields:
//android.view.View[.//android.widget.TextView[@text='hint_on_textfield']]//android.widget.EditText
example for column Name / “Nama” :
//android.view.View[.//android.widget.TextView[@text='Nama']]//android.widget.EditText
However, the problem is that all the data I try to input into different fields (e.g., Name, Age, Address, etc.) always end up being entered into the same field, namely the “No HP” (Phone Number) field.
Could someone please explain why this happens? Am I using the wrong XPath approach, or is there something I need to adjust in my locator strategy?
my XPath hierarchy :
here is my test script :
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpointimport static com.kms.katalon.core.testcase.TestCaseFactory.findTestCaseimport static com.kms.katalon.core.testdata.TestDataFactory.findTestDataimport static com.kms.katalon.core.testobject.ObjectRepository.findTestObjectimport static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObjectimport com.kms.katalon.core.checkpoint.Checkpoint as Checkpointimport com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKWimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobileimport com.kms.katalon.core.model.FailureHandling as FailureHandlingimport com.kms.katalon.core.testcase.TestCase as TestCaseimport com.kms.katalon.core.testdata.TestData as TestDataimport com.kms.katalon.core.testng.keyword.TestNGBuiltinKeywords as TestNGKWimport com.kms.katalon.core.testobject.TestObject as TestObjectimport com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUIimport com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windowsimport internal.GlobalVariable as GlobalVariableimport org.openqa.selenium.Keys as Keys
Mobile.startApplication(‘App-test\app-debug.apk’, true)
Mobile.tap(findTestObject(‘Object Repository/TC-02/android.widget.Button’), 0)
Mobile.tap(findTestObject(‘Object Repository/TC-02/android.widget.TextView - Pendaftaran’), 0)
Mobile.setText(findTestObject(‘Object Repository/TC-05/No HP’), ‘’, 0)
Mobile.setText(findTestObject(‘Object Repository/TC-05/Nama’), ‘Asep Surasep’, 0)
Mobile.setText(findTestObject(‘Object Repository/TC-05/Usia’), ‘21’, 0)
Mobile.setText(findTestObject(‘Object Repository/TC-05/Alamat Rumah’), ‘Jl. Jendral Sudirman N0.50’, 0)
Mobile.setText(findTestObject(‘Object Repository/TC-05/Nama Institusi Pendidikan’), ‘Universitas Testing’, 0)
Mobile.hideKeyboard() Mobile.setText(findTestObject(‘Object Repository/TC-05/Semester’), ‘5’, 0)
Mobile.hideKeyboard()
Mobile.setText(findTestObject(‘Object Repository/TC-05/NPM’), ‘21123123’, 0)
Mobile.hideKeyboard()
Mobile.setEncryptedText(findTestObject(‘Object Repository/TC-05/Sandi’), ‘p4y+y39Ir5PJb2ispxT0Ew==’, 0)
Mobile.hideKeyboard()
Mobile.setEncryptedText(findTestObject(‘Object Repository/TC-05/Konfirmasi Sandi’), ‘p4y+y39Ir5PJb2ispxT0Ew==’, 0)
Mobile.hideKeyboard()
Mobile.tap(findTestObject(‘Object Repository/TC-02/Button Kirim Pendaftaran’), 0)
Mobile.closeApplication()
Thank you in advance for your help.


