How to create different test scenarios from an endpoint?

**strong text*I have an endpoint and I want to create tests in postman with the following scenarios:

idPessoa field with: letter https://{{integrationURL}}/telefones/api/telefones?idPessoa=A

idPessoa field with: blank https://{{integrationURL}}/telefones/api/telefones?idPessoa=

For any of these scenarios the expected result is:

“error”: {
“errorCode”: “INT-VAL003”,
“message”: “Erro ao validar os dados de entrada.”,
“errors”: [
“schemaPath”: “#/properties/idPessoa/type”,
“params”: {
“type”: “number”
“message”: “deve ser um número”
The only test I’ve done at the moment for this case using pm is:


pm.test(“Status code is 200”, function () {;

pm.test(“Search by existing ID and validates if the id in the response is even informed”, function () {
var jsonData = pm.response.json();

Hey @silvio.aulik :wave:

What exactly are you trying to test?
You may be interested in this blog post that describes how to write dynamic tests based on the response: API Testing with Postman — Build a Dynamic Test Suite | by Michael Montgomery | assert(QA) | Medium