NEWMAN(二)

1.安装newman

npm install -g newman

安装node.js

Node -v  node -v 安装时会默认添加到环境变量中)

2. 验证

New man –version #Should show the latest version of Newman

3. postman导出文件和环境json

 


文件名分别为postman_collection.jsonpostman_environment.json

4.newman测试运行 命令行输入newman run D:\postman_collection.json -e D:\postman_environment.json

 

5.访问Jenkinshttp://localhost:8080/jenkins

 建立自由式项目

 

6.选择构建Execute shell输入commandnewman run D:\postman_collection.json -e D:\postman_environment.json

 

7.立即构建

newman -c D:\postman_collection.json -e D:\postman_environment.json  –exitCode 1

8. 控制台输出

 

 

控制台输入可能碰到以下问题

1newman -c D:\postman_collection.json -e D:\postman_environment.json  –exitCode 1

 

识别不了 –exitCode 1

2newman -c D:\postman_collection.json -e D:\postman_environment.json  –exitCode 1

 

原因不识别new -c改成newman run就对了

3)报错

 

json放在这个路径下就可以了

4) 正确命令newman run D:\postman_collection.json -e D:\postman_environment.json;乱码

 

解决方法:直接新建一个系统变量名为JAVA_TOOL_OPTIONS ;变量值为-Dfile.encoding=UTF-8 

保存并重启jenkins;可以通过查看系统管理系统信息–file.encoding(管理文件中的编码)已经修改,由GBK修改为UTF-8,但是sun.jnu.encoding(管理文件名的编码)没有修改

(如果想修改sun.jnu.encoding ,将之前设置改为JAVA_TOOL_OPTIONS ;变量值为-sun.jnu.encoding=UTF-8 即可)两者只能改其一

 

 

 

4)发现tomcat启动时候乱码了(tomatjenkins集成最好不要用war包)

 

在配置文件D:\tomcat\bin\startup.bat加入set JAVA_OPTS=-server -Dfile.encoding=gbk修复了

5)然后去看文件的错就可以了

1.安装newman

npm install -g newman

安装node.js

Node -v  node -v 安装时会默认添加到环境变量中)

2. 验证

New man –version #Should show the latest version of Newman

3. postman导出文件和环境json

 


文件名分别为postman_collection.jsonpostman_environment.json

4.newman测试运行 命令行输入newman run D:\postman_collection.json -e D:\postman_environment.json

 

5.访问Jenkinshttp://localhost:8080/jenkins

 建立自由式项目

 

6.选择构建Execute shell输入commandnewman run D:\postman_collection.json -e D:\postman_environment.json

 

7.立即构建

newman -c D:\postman_collection.json -e D:\postman_environment.json  –exitCode 1

8. 控制台输出

 

 

控制台输入可能碰到以下问题

1newman -c D:\postman_collection.json -e D:\postman_environment.json  –exitCode 1

 

识别不了 –exitCode 1

2newman -c D:\postman_collection.json -e D:\postman_environment.json  –exitCode 1

 

原因不识别new -c改成newman run就对了

3)报错

 

json放在这个路径下就可以了

4) 正确命令newman run D:\postman_collection.json -e D:\postman_environment.json;乱码

 

解决方法:直接新建一个系统变量名为JAVA_TOOL_OPTIONS ;变量值为-Dfile.encoding=UTF-8 

保存并重启jenkins;可以通过查看系统管理系统信息–file.encoding(管理文件中的编码)已经修改,由GBK修改为UTF-8,但是sun.jnu.encoding(管理文件名的编码)没有修改

(如果想修改sun.jnu.encoding ,将之前设置改为JAVA_TOOL_OPTIONS ;变量值为-sun.jnu.encoding=UTF-8 即可)两者只能改其一

 

 

 

4)发现tomcat启动时候乱码了(tomatjenkins集成最好不要用war包)

 

在配置文件D:\tomcat\bin\startup.bat加入set JAVA_OPTS=-server -Dfile.encoding=gbk修复了

5)然后去看文件的错就可以了

猜你喜欢

转载自blog.csdn.net/qq_38317509/article/details/81238843