Text from one object as property for other object

How to take Text using “getText(object) from one object” and use that text as property parameter for second object ?

Hi there,

Below is an example of it:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
‘Get text from the first object’
String commentText = WebUI.getText(findTestObject(‘Page_CuraAppointment/txt_Comment’))

‘Second object’
TestObject to = findTestObject(‘Page_CuraAppointment/txt_Comment’)

‘Use text from the first object as property parameter for second object’
to.addProperty(‘text’, ConditionType.CONTAINS, commentText)
to.findProperty(‘text’).setActive(true)

You can refer to all of TestObject APIs in this page: http://api-docs.katalon.com/studio/v4.5.0/api/com.kms.katalon.core/com/kms/katalon/core/testobject/TestObject.html

Thanks