Reputation: 85
I have followed the following Medium post on How to Configure postman / newman API tests in Azure DevOps or TFS and Publish HTML Results?
In my pipeline I have a task to install newman (Pass with command install newman -g
) and a task to run api tests.(Fail - Error: 'newman' is not recognized as an internal or external command.)
I have tried: A few solutions that can be found here and here .
In my Environment variables I have:
I did install newman using npm install -g newman
and if I run newman -v
I get a result of 5.2.2
.
My Azure task to run API request: newman run Auth.postman_collection.json -e UserAuthEnvironmentVariables.postman_environment.json --reporters cli,junit --reporter-junit-export Results\junitReport.xml
'C:\Users<user>\AppData\Roaming\npm' contains 3 newman files and C:\Users\RRQA.RRIOMQAS01\AppData\Roaming\npm\node_modules\newman
also contains files and folders.
My node version is v14.16.1
and npm version is 6.14.12
When I edit environment variables I do restart my the server to make sure changes did take affect.
Any other suggestions what I might try to figure out the issue.?
Upvotes: 2
Views: 5891
Reputation: 19979
When you are running command line from azure and when you locally login to the system it might be running under different user identities (one in admin and another in your account) so sometimes what ever you have installed or set in environment variable won't be available in the admin identity login.
Make sure the installation is done for all users. (Add path to system variable ) else:
install it as local module in the project directory as :
npm install newman newman-reporter-htmlextra
and use :
"./node_modules/.bin/newman" run
Upvotes: 3