mardi 6 avril 2021

Postman test looping for no apparent reason

I'm trying to write a test which changes the body for my request in Postman.

Somewhere in these lines, the code starts looping, and I have no clue why:

var newRequest = pm.request.clone();

newRequest.body.raw = JSON.stringify({
    companyIds : [5],
    take : 5
})

pm.sendRequest(newRequest, function (error, response) {
    pm.test("Status code is 403", function () {
        pm.expect(response).to.have.status(403);
    });
});

Can someone help me solve this? Thx

Aucun commentaire:

Enregistrer un commentaire