Folder Structure For API Automation

Main Collection

  • Reusable Functions
    • Prerequisite Data
      • API Tests
        • Persona1
          • Feature Name
            • Request
        • Persona2
          • Feature Name
            • Request

Is this the right folder structure in Postman for API automation. Functions are created inside objects specific to feature in Reusable Function folder better reusability.

FeatureName1 = {
functionName1 : function{
}
},
FeatureName2 = {
functionName2 : function{
}
}

Anything wrong with this approach?

Hey @gourish-mahale,

This is a very subjective and context based question. The basic answer would be…“it depends”.

Everyone uses Postman in a different way and there isn’t one approach that fits all use cases. If what you have works for you and your context, I would go with that.

What I would mention is that some of the workarounds that you’re doing for reusable scripts, might not be needed soon. Lots of very cool things coming into the product very soon. :pray:

Sounds good, Danny!! Can’t wait to get these new features rolled out… Currently in Postman, there’s some cons on reusing functions between folders defined at same level under main collection and following design patterns like SRP and others for API automation. Oops concepts can also not be followed.