A sample Test Case that creates a TestObject runtime
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
def createTestObjectByXPath(id, xpath) {
TestObject tObj = new TestObject(id)
tObj.addProperty('xpath', ConditionType.EQUALS, xpath)
return tObj
}
WebUI.openBrowser('')
WebUI.navigateToUrl("http://demoaut.katalon.com/")
TestObject tObj = createTestObjectByXPath("a_Make Appointment", "//a[contains(., 'Make Appointment')]")
WebUI.verifyElementPresent(tObj, 5, FailureHandling.STOP_ON_FAILURE)
WebUI.closeBrowser()