Run Postman collections using Python.
First, import the requirements
from postrunner.collection import Collection
from postrunner.runner import runner
Now open your collection and create an instance of Collection
with open(path_to_your_collection) as c:
str_collection = c.read()
collection = Collection(str_collection)
Add your collection to runner object and run it
runner.use_collection(collection)
runner.run()
To access the response of your requests use runner.CollectionName