Learn from experts and connect with global tech leaders at POST/CON 24. Register by March 26 to save 30%.

Learn more →
X

Meet Newman: a command line companion for Postman

Avatar

Update: We have a brand new blog post about our latest version of Newman.

Today, we are officially releasing a beta version of Newman  a command line companion tool for Postman. Newman lets you run Postman collections through your terminal. It can be installed easily through the Node.js package manager, npm, in a few seconds of all major operating systems. Being a command line tool, a screenshot would not do justice to how cool this is, but just in case you are wondering:

newman

With Newman, you can integrate Postman collections with your build system. Or you can run automated tests for your API through a cron job. You can also use Newman as a grunt plugin to run your API tests any time you save your code in your editor. There are tons of other ways to use Newman and we can’t wait for you to try it out!

The setup involved is absolutely minimal. You can check out the Newman repository on Github: https://github.com/postmanlabs/newman for more details. The code is licensed under the Apache license. Your contributions are welcome!

This has been one of the top feature requests since the release of Jetpacks and we are very excited to show this to you.

Learn more about command line integration with Newman.

Tags:

Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

21 thoughts on “Meet Newman: a command line companion for Postman

  • Avatar
  • Avatar

    When I execute my collection in Newman (which works perfectly fine in Postman) using this command:
    newman -c My_Test_Collection.json -e My_Test_Environment.json
    I get this for ALL POST requests:
    Iteration 1 of 1
    EXCEPTION – SyntaxError: Unexpected token u
    RequestError: 09ac9904-1936-b220-6527-5671340530ff terminated. Error: undefined
    :
    However, e.g. GET and PUT work ok. What could be the issue here?

    • Avatar

      Hi Pete,

      Can you post an issue along with your collection on https://github.com/a85/Newman? We’ll look into it.

      Abhinav

      • Avatar

        Hi, I have the same issue with the same error message, has this been anyhow resolved?

        Thank you.

        Iteration 1 of 1

        EXCEPTION – SyntaxError: Unexpected token u

        RequestError: 11c97cf3-c208-dfde-9b37-4f42814951c2 terminated. Error: undefined

        • Avatar

          Petr,

          I think all pending Newman issues with running collections have been resolved. Try updating Newman and see if your collection works now.

  • Avatar

    Awesome! Definitely checking this out tonight!

  • Avatar

    Fantastic, finally! And excellent naming choice!

  • Avatar

    Has anyone tried integrating Newman with a Maven pom for automated integration testing? I was thinking of using the plugin for this. Any thoughts or ideas on how to go about this?

  • Avatar

    I’m having an issue with running my collection. I’m running the command “newman -c {collection}.json” and I’m getting the response “Please specify a Postman Collection either as a file or a URL”. I know my syntax is right. Is there something I’m missing?

  • Avatar

    Is anyone having issues with jquery tests using Newman? I keep getting the following error after running my tests.

    EXCEPTION – ReferenceError: jQuery is not defined

  • Avatar

    Very nice! Looks like an amazing companion to the rest2mobile tool that generates native mobile code for the REST APIs: http://developers.magnet.com/

  • Avatar

    Awesome! Looks like an amazing companion to the rest2mobile tool that generates native mobile code for the REST APIs: http://developers.magnet.com/

  • Avatar

    Will Newman work if called by PowerShell?

  • Avatar

    Must say a very cool step.
    A little more documentation will be really great. I am unable to capture the token generated to use it on subsequents calls. I need to parse resonseBody and find it. All I can find is how to do it in Postman. Command line is what we are looking for.

    • Avatar

      Have you had any success with this? If so, I would be grateful for you to share, I am just getting started with Newman, and I won’t be able to do much with it if I cannot get past the authentication barrier.

      Thanks,
      Jeremy

      • Avatar

        Well, I bought the paid version of Postman. It solved most of the hurdles I was facing! ^^

  • Avatar

    The tool is good..would be great if it can give database connectivity provisions for automated testing.

    • Avatar

      Were you able to connect to DB (in our case it is postgress)?
      Here is what I am trying to test –
      1. Execute an API
      2. If response is success, then tables in postgress are updated.

      I would like to see a feature in POSTMAN using which I can connect to our DB and validate if data is copied from one table to another or data is deleted or data is inserted or any other sort of data validation.

      If you have set-up automation for above, please provide some lead. Thanks in advance

      • Avatar

        I love this tool but I also have a need for data validation. Can anyone answer the question of database connectivity. Could we do it via a javascript snippet of some sort? Thanks.

  • Avatar

    Hi Team,

    Using Newman, we are able to run our collection and get the resuts. I used the below command to get it.

    newman -c collection.json -e env.json -H results.html.

    In the generated report if we need to get the failed cases alone by highlighting it, then what could be the command we should use for it?

  • Avatar

    When I execute my collection in Newman using this command:
    newman -c C:\Users\qq\Desktop\csd.postman_collection.json -e C:\Users\qq\Desktop\csd.postman_environment.json
    however,return the below error:
    1. Error unable to verify the first certificate
    at request
    inside “accounts_signout” of “csd”
    2. TypeError Cannot read property ‘value’ of undefined
    at test-script:5:55
    inside “accounts_signout” of “csd”
    Could you please help me to resolve?thanks!