从SoapUI中的REST请求获取端点



我正在尝试制作一个SOAPUI REST mock。我有一个看似简单的问题,但我就是找不到答案。你能告诉我如何使用groovy从请求中提取端点吗?

使用ReadyAPI(SOAPUI pro(,我个人使用以下脚本:

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

最新更新