Hi, I am writing a test script where I am using an environment variable, setting it to a constant value in pre-request script and finally, assigning it to my request body parameter.
Pre-request Script - var code = "b0d159"; pm.environment.set("offeringCode", code)
Test Script (test that is failing) - pm.test('response code is 200', function () { pm.response.to.be.ok; });
I am setting an already existing value (exists in db) to the variable, thus the request should return āOverlapping offering codeā in response body.
While running the request/ collection from postman expected response comes with a 200 Ok status, however, Newman returns āMissing Parameterā with a 404 Not Found status.
In Newman, the ādetailā column for assertion error says - " response code is 200
expected response to have status reason āOKā but got āNOT FOUNDā at assertion:0 in test-script inside āOverlapping Offering Codeā
Hey there, I found what went wrong using htmlextra! One of the environment variables was in wrong format which was causing the āMissing Parameterā response, I included the right code in pre-request script and now it works! Thank you