Search code examples
tfstfsbuildpostmantfs-2015

Running postman test via newman in command line in TFS build


I try to run a Web API Postman test in a TFS build step. Postman has it's own command line tool called Newman. When running my tests in command line on my build server, everything works fine. When trying to run the same command via TFS command line build step, I get the error

'specified executable is not a valid application for this os platform'

Note that newman is a npm package which has been previously installed on the build machine.


Solution

    1. Please set the account which you succeed to run the command as the build agent services account.
    2. Restart the build agent service
    3. Add a npm task before the Command Line task to install the newman within the build process. Reference below screenshot.

    Try it again. enter image description here