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:

https://{{integrationURL}}/telefones/api/telefones?idPessoa=1444

pm.test(“Status code is 200”, function () {
pm.response.to.have.status(200);
});

pm.test(“Search by existing ID and validates if the id in the response is even informed”, function () {
var jsonData = pm.response.json();
pm.expect(jsonData.content[0].idPessoa).to.eql(1444);
});
*

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