forked from bardia-heydari/postpython
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Hi,
I was looking for a tool to execute collection in parallel. Though this can be achieved by writing script using newman (from postman), it needs nmp setup in my machine. Since, I don't use NPM I was looking a simpler approach and found this project.
Now, the only problem here is I have to write method names in my code that is too much of coding.
Below enhancements will be beneficial for users:
- Option to access the methods in list format and then execute the same.
e.g.:
# ===============================================================
# Get filtered the collection Items and requests
# ===============================================================
runner = PostPython('/path/to/collection/postman_collection.json')
collection_items = runner.get_collecdtion_items()
for collection_item in collection_items:
requests = collection_item.get_requests()
for request in requests:
response = request()
# ===============================================================
# Get filtered the collection Items and requests
# ===============================================================
runner = PostPython('/path/to/collection/postman_collection.json')
# collection items containing certain string
collection_items = runner.get_collecdtion_items("*foo*")
for collection_item in collection_items:
# requests starting with certain string
requests = collection_item.get_requests("bar*")
for request in requests:
response = request()
- Option to execute the methods by its name
e.g.:
runner = PostPython('/path/to/collection/postman_collection.json')
response = runner.execute_reqeust("CollectionItem.get_request")
- Option to execute the whole collection (with filter)
e.g.:
runner = PostPython('/path/to/collection/postman_collection.json')
responses = runner.execute_collection(filter="*foo_bar*" , parallel=true)
for response in responses:
print(response.json())
print(response.status_code)
- Option to execute the whole collection (with filter)
e.g.:
runner = PostPython('/path/to/collection/postman_collection.json')
responses = runner.execute_collection(filter="*foo_bar*" , parallel=true)
for response in responses:
print(response.json())
print(response.status_code)
This will be helpful in case of collection with lots of requests.
Metadata
Metadata
Assignees
Labels
No labels