Postman - How to get the parameters and values passed (Query Params) for validation?

need to get the parameters and values ​​passed in the url (Query Params) to validate these values.

The parameter and value are passed like this in the url:


I want to validate the value passed in this parameter in the test script. I was able to validate when it happened in the body, but I need to validate when it happened in Params. Please, help!

Hi @mirellae2e! I’m having a bit of trouble understanding what you’re asking. Can you elaborate a bit on what you mean when you say you want to “validate the value passed in the parameter in the test script?” What is the current code in your Tests tab?

Hello, in my test script I did validating the request body, now I need to validate the request’s Params.

//Validate Field
pm.test(“Field is between 1 and 100.”, function () {

var req = JSON.parse(pm.request.queryParams); // this does not work

pm.environment.get("value", req.value);




1 Like

Can you tell me how to make sure that a field is not between 1 and 10? I managed to do it to show when it is between 1 and 10, now I need to show when it is not to be, to be an invalid test.

Here the example that must be between 1 and 10, now I need one that should not be between 1 and 10.

pm.test(“Field 0 and 30.”, function () {

var req = JSON.parse(pm.request.body.raw);

pm.environment.set("field", req.field);




    pm.expect(2), 3); 

Postman is based on chai assertions so you can use within

Expect / Should - Chai

1 Like