SoapUI/Groovy: can not get response when set test step name variable -
my groovy code below. can request , response when use real test step name in the:
def request=context.expand('${"teststepname"#request}') def response=context.expand('${"teststepname"#response}')
when change use variable:
def request=context.expand('${${currentstep.name}#request}') def response=context.expand('${${currentstep.name}#response}')**
i can request, while fail response. error is
org.apacge.xmlbeans.xmlexception: error: unexpected end of file after null error @ line: xx
the test step currentstep points has been executed , has request/reponse.
can anyboby here kindly me?
import com.eviware.soapui.support.xmlholder import com.eviware.soapui.impl.wsdl.testcase.wsdltestruncontext import groovy.sql.sql import oracle.jdbc.driver.oracletypes import com.eviware.soapui.impl.wsdl.teststeps.wsdltestrequeststep def currentstep = testrunner.testcase.getteststepat(6) log.info "currentstep.name: " + currentstep.name // hold of request def request=context.expand('${${currentstep.name}#request}') log.info " request: " + request // desired node value request def xmlreq=new xmlholder(request) // hold of response def response=context.expand('${${currentstep.name}#response}') log.info " response: " + response // desired node value response def xmlres=new xmlholder(response)
i solved issue efter reading message.
string propertyspec = '${' + currentstep.name + '#response}' log.info "propertyspec : ${propertyspec}" def response = context.expand(propertyspec) log.info("context.expand(propertyspec) : ${response}") def xmlres=new xmlholder(response)
Comments
Post a Comment