DEV Community

Cover image for How to fixed Postman API Test Collection using Nodejs (newman)and Unicode Problem Windows 10
Hirok Sarker
Hirok Sarker

Posted on • Edited on

How to fixed Postman API Test Collection using Nodejs (newman)and Unicode Problem Windows 10

Our main goal of continuous integration is to identify the problems that may occur during the development process earlier and more easily.
Passionate about automation and optimizing the best processes. Continuous Integration (CI) is a software development practice that is based on a frequent integration of the code into a shared repository.
Most commonly used Jenkins because Jenkins is an open-source automation server. Its main objectives are to detect changes in subversion or git and to perform tasks repeatedly (i.e., build, test, deploy, package, integrate). In general, Jenkins allows one to create a complete CI cycle.
Continuous Integration Systems has many benefits but sometimes face setup related issues. To fixed two-issue windows to console reports and Unicode related issues.

How to run newman command in Jenkins-
Pre-requirement — Install Nodejs — https://nodejs.org/en/
Choose new FreeStyle Project-
Alt Text
Then choose Build > Execute Windows batch command
Alt Text
The console output result should look like this: (Windows)
Alt Text
Ok. Now everything ready but newman issue. Now we need to fix that newman issue.
First Need to install — Nodejs Plugin > Manage Plugins > Available > Search — Nodejs > Check box > Install and Restart
Now let’s go to Jenkins > Manage Jenkins > Global Tools Configuration
Alt Text
Apply then Save. :)
Now Edit Project —
Alt Text
Check box click — Provide Node & npm bin / folder to PATH. Apply & Save
Again Build Now —
Alt Text
Congratulations! but one more issue again. Unicode related issue :(.
UTF-8 encoding issue resolution method in Jenkins — (One)
Go to Install Project directory — C:\Program Files (x86)\Jenkins
Open > jenkins.xml
Alt Text
-Dfile.encoding=UTF8
Save then Restart — Jenkins Service
Alt Text
Again Build Now —
Alt Text
Congratulations and Successfully Fixed Unicode Issue.
Another different way to fix Unicode issue -
To resolve the encoding issue we have to add the environment variable in system as shown below first.
Alt Text
Alt Text
Save then Restart — Jenkins Service
Alt Text
These environment variables were added in Jenkins as well which has resolved the encoding issue.
Jenkins -> Manage Jenkins -> Configure System ->Global properties.

Top comments (0)