I'm using Artillery.io (v2.0.23) to make a POST call. And in my request body, I want to pass a string that contains double curly braces as follows:
json:
text: "Hello {{ firstName }}"
But Artillery tries to interpret this as a variable called firstName and converts it to Hello undefined. To go around this, I've tried a bunch of things as follows
Hello {{`{{firstName}}`}}Declare a new variable called
variables: firstNameUnescaped: "{{firstName}}" json: text: "Hello {{ firstNameUnescaped }}"Use a JS processor in the test YAML file
beforeRequest: "sendCurlyBracedBody"And in the processor
module.exports = { sendCurlyBracedBody: function (requestParams, context, ee, next) { requestParams.json = { text: "Hello {{firstName}}" } } }
None of the above three approaches helped. I see Artillery interpreting it as a variable and converting it to Hello undefined. How to pass that string without Artillery trying to read it as a variable?
-
Looks like a known bug: github.com/artilleryio/artillery/issues/1456jonrsharpe– jonrsharpe2025年05月27日 06:38:25 +00:00Commented May 27, 2025 at 6:38