I am using the task "Newman the cli Companion for Postman" (Link) in a YAML pipeline to run Postman collections for testing and warm up purposes.
I use the task like the following:
- task: carlowahlstedt.NewmanPostman.NewmanPostman.NewmanPostman@4
displayName: 'Newman - Postman'
inputs:
collectionFileSource: '$(Pipeline.Workspace)/drop/Postman'
Contents: '**\*_collection.json'
folder: Release
environment: '$(Pipeline.Workspace)/drop/Postman/$(Environment).postman_environment.json'
ignoreRedirect: false
bail: false
sslInsecure: false
reporters: 'html,junit'
reporterHtmlExport: '$(Pipeline.Workspace)/drop/Postman'
htmlExtraDarkTheme: false
htmlExtraLogs: false
htmlExtraTestPaging: false
reporterJUnitExport: '$(Pipeline.Workspace)/drop/Postman'
Doing so on a hosted agent works fine but when working with a self-hosted one I get:
##[error]Unable to locate executable file: 'newman'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
I have newman as well as newman-reporter-html installed on the agent and am able to run it when logged in to the agent.
How can I resolve this issue?
npm install -g newman
andnpm install -g newman-reporter-html
– quervernetzt