Hello, I want to test negative GET API requests. I have already positive requests so should I add negative scenarios to the existing positive test scripts in tests tab as pm.sendRequest with invalid value or should I create new negative scenarios? What’s the best practise?
pm.globals.set(“productId”,“abcde”); pm.test(“Status code is 404”, function (){ pm.sendRequest(‘https://api.xyz/{{productId}}/stock-availability?Ids=24’, function (error, response) { pm.response.to.have.status(404); }); });
This code inside tests tab after positive test scripts doesn’t work.