0

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

  1. Hello {{`{{firstName}}`}}

  2. Declare a new variable called

    variables:
     firstNameUnescaped: "{{firstName}}"
    json:
     text: "Hello {{ firstNameUnescaped }}"
    
  3. 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?

jonrsharpe
123k31 gold badges278 silver badges489 bronze badges
asked May 27, 2025 at 4:08
1

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.