Class Collection


public class Collection extends ItemGroup

Encapsulates a Postman collection

Postman SDK analog: Collection

Ingest a collection file

Collection myCollection = pmcFactory(new File("example-cat-facts-with-tests.postman_collection.json");

Ingest a collection from Postman

  PostmanID myID = new PostmanID("invalid input: '&#60'your-collection-idinvalid input: '&#62'"); 
  Collection myCollection = Collection.pmcFactory(myID);
 

Get a request item

Item myReq = myCollection.getItem("Get Random Fact");

Get pre-request script for the request

Event preReq = myReq.getPreRequestScript();

Get source code for pre-request script

String myCode = preReq.getSourceCode();