Forum Discussion
- JHuntCommunity 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 null
INFO:SomeRestTestStep: My XPath Match Assertion
INFO://*:status = OK - nmraoChampion Level 3Himanshu001, the use case seemed to be interesting.
Would you please tell a little more on how you are going to use external for the assertions and assert them dynamically. Appreciate your time.
Related Content
- 6 years ago
Recent Discussions
- 15 years ago