0

I have a test scenario as follows:

scenarios:
  - name: "Test"
    flow:
     - post:
         url: "/someEndpoint"
         form:
           some_array: ['3','2','1']
         afterResponse: "logBody"

I want to move the data that some_array is going to be submitted with from a payloads bank. How can I achieve this when the payload data itself would need to be wrapped in double quotes to preserve the string within a csv?

Payload data would look like this:

some_array
"['3','2','1']"

Everytime I try to pull this data in it's being pulled in as a string rather than an array and my server when submitting the post is responding that it doesn't know what to do with this.

EDIT (more info): Would also like to add that the length of this array from the payload is going to be dynamic not static.

simon
  • 854
  • 1
  • 9
  • 23

1 Answers1

1

don't wrap the payload request in a string, even though the api specifically says you should. perhaps a bug or abuse but it works.

In other words, what I was trying to do was this:

scenarios:
  - name: "Test"
    flow:
     - post:
         url: "/someEndpoint"
         form:
           some_array: "{{ some_array }}"
         afterResponse: "logBody"

But this fixes it:

scenarios:
  - name: "Test"
    flow:
     - post:
         url: "/someEndpoint"
         form:
           some_array: {{ some_array }}
         afterResponse: "logBody"
simon
  • 854
  • 1
  • 9
  • 23