webserviceAutom
12 years agoOccasional Contributor
JDBC test step assertion gives NULL output
Hi,
I have a JDBC test step and I created a script assertion to store the response into properties test step.
Everytime I run the script assertion I get an error pop up with "null" message ( see attached screen shot)
Even though I get null message the response is stored into properties test step successfully.
Any idea why I am getting error pop up with "null" message.
Script Assertion below:
If I remove the text in red, then the error pop up with "null" message goes away, is there any other way of storing response into a properties test step?
====================================================================
import com.eviware.soapui.support.XmlHolder
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "RetrieveBatchNumber#ResponseAsXml" )
def myProps = new java.util.Properties();
def testCase = messageExchange.modelItem.testCase
myProps = testCase.getTestStepByName("BatchNumber");
// loop item nodes in response message and store actual record values
for( item in holder.getDomNodes( "//Row" )){
def batchNum= groovy.xml.dom.DOMCategory.xpath(item, "//BATCH.BATCH_NUM")
def rcdDate= groovy.xml.dom.DOMCategory.xpath(item, "//BATCH.RCD_DATE")
myProps.setPropertyValue("expectedBatchNum",batchNum)
myProps.setPropertyValue("expectedDate",rcdDate)
}
I have a JDBC test step and I created a script assertion to store the response into properties test step.
Everytime I run the script assertion I get an error pop up with "null" message ( see attached screen shot)
Even though I get null message the response is stored into properties test step successfully.
Any idea why I am getting error pop up with "null" message.
Script Assertion below:
If I remove the text in red, then the error pop up with "null" message goes away, is there any other way of storing response into a properties test step?
====================================================================
import com.eviware.soapui.support.XmlHolder
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "RetrieveBatchNumber#ResponseAsXml" )
def myProps = new java.util.Properties();
def testCase = messageExchange.modelItem.testCase
myProps = testCase.getTestStepByName("BatchNumber");
// loop item nodes in response message and store actual record values
for( item in holder.getDomNodes( "//Row" )){
def batchNum= groovy.xml.dom.DOMCategory.xpath(item, "//BATCH.BATCH_NUM")
def rcdDate= groovy.xml.dom.DOMCategory.xpath(item, "//BATCH.RCD_DATE")
myProps.setPropertyValue("expectedBatchNum",batchNum)
myProps.setPropertyValue("expectedDate",rcdDate)
}