# How to create different test scenarios from an endpoint?

**URL:** <https://community.postman.com/t/how-to-create-different-test-scenarios-from-an-endpoint/46753>\
**Category:** Help Hub\
**Tags:** tests\
**Created:** [April 25, 2023, 4:00pm UTC](https://community.postman.com/t/how-to-create-different-test-scenarios-from-an-endpoint/46753 "2023-04-25T16:00:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![silvio.aulik](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/silvio.aulik/32/15645_2.png) [@silvio.aulik](https://community.postman.com/u/silvio.aulik)\
**Post date:** [April 25, 2023, 4:00pm UTC](https://community.postman.com/t/how-to-create-different-test-scenarios-from-an-endpoint/46753/1 "2023-04-25T16:00:32Z")

</div>

\*\*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);  
});  
\*

---

<div class="post-metadata">

**Author:** ![arlem](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/arlem/32/3078_2.png) [@arlem](https://community.postman.com/u/arlem)\
**Post date:** [April 26, 2023, 9:44am UTC](https://community.postman.com/t/how-to-create-different-test-scenarios-from-an-endpoint/46753/2 "2023-04-26T09:44:14Z")

</div>

Hey @silvio.aulik 👋

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](https://medium.com/assertqualityassurance/api-testing-with-postman-build-a-dynamic-test-suite-e874f4d78e69)
