这是 __admin/mappings: 我有这样的回应: “回复”: { “状态”:200, "headers":{"Content-Type" : "application/json"}, "body": {"transactionID": "{{randomValue length=12 type='NUMERIC'}}","statusCode": "S01"} }
我想在 postServeActions 中使用相同的随机数。我该如何通过?
"postServeActions" :
[{
"name" : "webhook",
"parameters" : {
"method" : "POST",
"url" : "http://127.0.0.1:8081/sts/ADD?FILENAME=transactions.txt&LINE=<transactionID>&ADD_MODE=FIRST&UNIQUE=TRUE"
}
}]
(没试过)
如果您的问题与 Wiremock 相关,根据 响应模板 - 随机值,您应该能够使用以下内容:
{{randomValue length=10 type='NUMERIC'}}
如果你想在 JMeter 中做同样的事情,你可以使用 __Random() 函数
${__Random(1000000000,9999999999,)}
有关 JMeter 函数概念的更多信息:Apache JMeter 函数 - 简介