Organizing tests for API imported from openapi schema

I am new to the API test automation in Postman and test automation as a whole . But currently I have a task to automate the API testing in our company. I have been researching for about 2 weeks how to set up the testing project but still can`t find how to do what it is expected from me. I will try to explain what I am looking for.
I have imported the API through openapi schema and I need to add the tests. In the API version detail screen there is tab “Test” where you can add new collection or existing one to the given version of the API. When choosing “+Add test suit → Create new test” a collection with all endpoints defined in the schema is generated. My question is how to organize the tests having these endpoints? All examples I have seen are of collection of tests or test suits not tied to concrete API schema.

Are you trying to test the API schema, or create tests for each endpoint?


I have to test each endpoint.

I guess it’s down to personal preference, but personally, I would probably create a collection and then have a ‘http request’ for each call to be made, and within each request use the ‘Tests’ tab to specifically test that http request… Like this;

You could do collection level tests if there was a test you wanted to repeat for all calls within said collection.

You can also add folders to collections to ‘group’ certain calls.

collection can then be exported, so the whole test case/scenario was within one collection you could store it in github etc)

Thank you for your example and explanation. My approach is close to your suggestion. The problem is that my manager states that I have to organize the tests around the endpoints generated from the schema and they have to correspond to the version of the API schema. For the next version of the API the tests should be kept and upgraded/complemented.

I’m just starting out with postman automation so would be keen to see what you come up with as the final structure.

I would probably be asking my manager for an example of what he/she wants…
If there are multiple calls for each endpoint, it may be that each endpoint needs a top-level folder like this;

(With the schema version being correllated to the collection …)

This is my organization for the first endpoint by now

Don’t see an issue there personally. Maybe ask your manager to map out how they want it altered…

Postman api generates the collection according schema structure now just add tests to your api . You can basic tests are run your entire tests using data driven approach

hello are you going well with your automation test ?

still setting up things. Now I am going to use data driven approach.

Ok , just to understand ore you are using Postman Runner to run your test collection or what ?

The final goal is to run the tests in the Azure DevOps pipeline