Get Object Properties from Object Repository

Hi,

well im trying to get the object properties from Object Repository . Eg. I have a object in Object Repository like “Button” and with property of Xpath. I just want to read this Xpath value. Is there any way i can do this ? Im not creating run time object object already available in the Object Repository .

I have done where we have object during the run time but I want to do this from Object Repository

For the run time object : myTestobjet. getPreoperties();

Is there any way please ?

Here I assume you have a Test Object ‘Object Repository/Page_CuraHomepage/a_Make Appointment’.

In your test case

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.testobject.TestObject as TestObject

TestObject tObj = findTestObject('Object Repository/Page_CuraHomepage/a_Make Appointment')
println "${tObj.findPropertyValue('xpath')}"

you will see in the log

09-27-2018 05:18:34 PM - [START]  - Start action : Statement - println($tObj.findPropertyValue(xpath))
id("btn-make-appointment")

See also the Katalon API document at https://api-docs.katalon.com/studio/v4.8.0/api/com/kms/katalon/core/testobject/TestObject.html#findPropertyValue(java.lang.String)

3 Likes

Thanks its working perfect now able to do more dynamic things :slight_smile: