Skip to content

Enhancement: Option to allow to access all the methods dynamically #17

@gitphoex

Description

@gitphoex

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:

  1. 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()
  1. 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")

  1. 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)

  1. 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions