Get endpoint from REST request in SoapUI

Viewed 77

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?

1 Answers

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())
Related