Reputation: 21
I'm trying to make a SOAPUI REST mock. I have a seemingly simple question, but I just can't find an answer for it. Can you tell me how to extract an endpoint from request using groovy?
Upvotes: 2
Views: 178
Reputation: 2387
with ReadyAPI (SOAPUI pro) I personnaly use the following script :
def env = testRunner.testCase.testSuite.project.activeEnvironment
rest = env.getRestServiceAt(0)
config = rest.getEndpoint().config
endpoint = new XmlSlurper().parseText(config.toString())
testRunner.testCase.setPropertyValue("endpoint", endpoint.toString())
Upvotes: 1