Forum Discussion
JHunt
8 years agoCommunity Hero
I'm not sure what output format you wanted, but here's how to get hold of the objects in Groovy:
import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep
import com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.XPathContainsAssertion
Map assertions = [:]
testRunner.testCase.project.testSuites.each { testSuite ->
testSuite.value.testCases.each { testCase ->
testCase.value.testSteps.each {
def testStep = it.value
if (testStep instanceof WsdlTestRequestStep || testStep instanceof RestTestRequestStep) {
testStep.assertions.each {
def assertion = it.value
if (assertion instanceof XPathContainsAssertion) {
assertion.XPathReferences.each { xpathReference ->
assertions["${testStep.name}: ${assertion.name}"] = "${xpathReference.XPath} = ${assertion.expectedContent}"
}
}
}
}
}
}
}
assertions.each {log.info it.key; log.info it.value}
return nullINFO:SomeRestTestStep: My XPath Match Assertion
INFO://*:status = OK