JDBCrequst from groovy script,After successful connection and query executed.How to set response .
//query executed from script
def con = Sql.newInstance("jdbc:oracle:thin:@vXXX:XXX", "XXX", "XXX", "oracle.jdbc.driver.OracleDriver")
//Sucessfully Connected Database
def respId = con.rows("SELECT CODE from STATUS where STATUS_ID = '22' "
//Now getting proper response. Hear how to add response name value to Property from groovy script.
//query executed from JDBCRequst from jdbc custom property i am seting values to PropertyStep
//if i am run JDBCRequst with out script i can save the response in property as ResponseAsXml with that property i can save values into property using script.
def step = context.testCase.testSteps['Properties']
step.propertyNames?.each {
step.removeProperty(it)
}
//Parent nodes like Result,ResultSet,Row
dbdata.'**'.find{
//log.info it.name()
it.name() == 'Row'
}.childNodes().each {
//log.info "${it}"
def prop = step.hasProperty(it.name()) ? step.getProperty(it.name()) : step.addProperty(it.name())
//log.info prop
prop.value = it.text()
//log.info it.text()
.