I need to test some functionality x amount of times, let’s say 10 times for this purpose.
Is it possible to change the body in the request that is being sent through pm.sendRequest(), each iteration?
I do have a body in the main request that and I use like this:
const req = {
url: `${host}
method: ‘POST’,
header: {
},
body: {
mode: ‘raw’,
raw: pm.request.body.raw
}
}
And inside the main body-request I use variables that i.e, sets random numbers on some of the fields, like this:
"amount": "{{amount}}"
But when I run the request, the body doesn’t change, so I get the same response 10 times.
Is this even possible through script?