MPleas
11 years agoOccasional Contributor
How do I get property transfer step information via Groovy?
Hi - I'm looking for examples using PropertyTransfer and I don't see any that are working for me. I want to grab information on the Property Transfer test step I have via Groovy. Below is just a very scaled down script as an example. I have a Property Transfer test step with just one transfer within it. When I run the script below, everything is null. I assume it's because there can be more than one transfer within a Property Transfer test step. However, I don't see a way to pass in the index into any of the methods. I also don't see anything that would allow me to iterate through the various transfers within the Property Transfer test step (i.e. something like: for (def prop in propTxfr()) or any methods that bring back a 'list' of transfers. Does anyone know how to do this?
import com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer
def tCase = testRunner.testCase.testSuite.testCases[testRunner.testCase.name]
def tStep = tCase.testSteps["PropertyTransfer"]
def propTxfr = new PropertyTransfer(tStep)
log.info "GetName: " + propTxfr.getName()
log.info "GetSourcePath: " + propTxfr.getSourcePath()
log.info "GetSourcePropertyName: " + propTxfr.getSourcePropertyName()
log.info "GetSourceStepName: " + propTxfr.getSourceStepName()
log.info "GetTargetPath: " + propTxfr.getTargetPath()
log.info "GetTargetPropertyName: " + propTxfr.getTargetPropertyName()
log.info "GetTargetStepName: " + propTxfr.getTargetStepName()
import com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer
def tCase = testRunner.testCase.testSuite.testCases[testRunner.testCase.name]
def tStep = tCase.testSteps["PropertyTransfer"]
def propTxfr = new PropertyTransfer(tStep)
log.info "GetName: " + propTxfr.getName()
log.info "GetSourcePath: " + propTxfr.getSourcePath()
log.info "GetSourcePropertyName: " + propTxfr.getSourcePropertyName()
log.info "GetSourceStepName: " + propTxfr.getSourceStepName()
log.info "GetTargetPath: " + propTxfr.getTargetPath()
log.info "GetTargetPropertyName: " + propTxfr.getTargetPropertyName()
log.info "GetTargetStepName: " + propTxfr.getTargetStepName()