我在下面的 api 调用中使用随机数,但它给出了错误。
"post": {
"url": "https://host/abc?Id=1&Amount={{{$randomNumber(4000,40000)}}}&rate={{{$randomNumber(1000000,1200000)}}}&amountType=1"
}
它给出的错误为
{ Error: Line 1: Unexpected token }
at createError (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:2392:21)
at unexpectedTokenError (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:2467:13)
at throwUnexpectedToken (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:2472:15)
at parsePrimaryExpression (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:3266:13)
at inheritCoverGrammar (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:2648:18)
at parseLeftHandSideExpressionAllowCall (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:3373:20)
at inheritCoverGrammar (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:2648:18)
at parsePostfixExpression (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:3449:16)
at parseUnaryExpression (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:3509:20)
at inheritCoverGrammar (C:\Users\chintamanim\AppData\Roaming\npm\node_modules\artillery\node_modules\esprima\esprima.js:2648:18)
index: 29,
lineNumber: 1,
column: 30,
description: 'Unexpected token }' }
Unexpected error, Artillery shutting down.