Edark
Edark

Reputation: 21

Get endpoint from REST request in SoapUI

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

Answers (1)

A.Joly
A.Joly

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

Related Questions