如何每次使用 Soap UI 中的 groovy 脚本传递动态生成的值(对于 REST API)-响应在 CDATA 中的 json 中

how to pass dynamically generated value everytime with groovy script in Soap UI (for REST API) - Responce is in json inside CDATA

目前已经从 "GET" 测试用例中提取了值,并希望将其传递给 "PUT" 请求(在正文中)。 enter image description here

您可以将值设置为测试用例属性:

// You'll have to add an 'idProperty' property yourself against the test case
def String id = json.entities.id
testRunner.TC_1.setPropertyValue("idProperty", id)

然后,在下一个请求中随心所欲地使用 属性:

${#TestCase#idProperty}

有关详细信息,请参阅 Property Expansion