Skip to content

postman.setNextRequest does not work as expected when the collection is run in the command line using newman #2533

Open
@saiudayakella

Description

@saiudayakella

Version and environment information:

  1. Newman Version (can be found via newman -v): 5.1.2
  2. OS details (type, version, and architecture): Windows 10
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: I believe, always there
  5. Expected behaviour: Next request set in the function `postman.setNextRequest('request-id') should be executed
  6. Command / script used to run Newman: newman run "<collection.json>" --folder "" -e "<environment.json>" -g "<globals.json>"
  7. Sample collection, and auxiliary files (minus the sensitive details):
  8. Screenshots (if applicable):
    image

Steps to reproduce the problem:

  • Fetch the id of next request to be executed in the flow. I fetched this via postman API
    image

  • Based on the desired flow, set the next request via request_id

  • Run the collection in collection runner and in the command line using newman

Observation:

  • Collection runs without any issues in collection runner whereas it fails in commandline. Refer the screenshot attached above.

  • Surprisingly when the next request is set via request_name, I do not encounter this problem. But the issue is we have requests with same name under different folders and as id is unique, this will be preferred way of setting the request workflow for us

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions