Forum Discussion
marcpa
11 years agoOccasional Contributor
Not exactly, but close.
Try this:
Try this:
def previousTestStep = context.testCase.getTestStepAt(context.currentStepIndex - 1)
String propertySpec = '${' + previousTestStep.name + '#Response}'
log.info "propertySpec : ${propertySpec}"
def response = context.expand(propertySpec)
log.info("context.expand(propertySpec) : ${response}")
def document = new XmlSlurper().parseText(response)
def allNodes = document.depthFirst().collect{ it }
allNodes.each { node ->
log.info "node named '${node.name()}' has content :"
log.info node.text()
}
log.info "DONE"
Related Content
Recent Discussions
- 7 days ago