本文介绍了有什么方法可以在 Postman 中自动化 API 测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以让我在 Postman 中自动化 API 测试吗?

Is there any way such that I can automate API testing in Postman?

我有一组 API,手动测试需要很多时间.如果可以在文件中提供输入 JSON,以便它从该文件中获取输入并进行测试并给出结果是否成功,那就太好了.

I have a set of APIs and testing it manually takes a lot of time. It would be great if it is possible to give the input JSON in file so that it takes input from that file and test and give results whether its success or fail.

谢谢.

推荐答案

是的,您可以使用以下内容:

Yes, you can make use of the following:

  1. 收藏跑者
  2. Postman 中的监视器
  3. 纽曼

解释:

  1. 使用集合运行器,您可以一次性运行一组请求(API 端点),同时您还可以编写测试,然后它会告诉您有多少测试通过/失败.您可以使用集合运行器执行更高级的操作,例如使用 postman.setNextRequest

您可以使用 Postman Monitors,它基本上是您的集合在预定时间(每天/根据您指定的时间表)在云中运行,然后显示监视器报告,这基本上会给您API 的性能指标和测试报告.

You can make use of Postman Monitors which is basically your collection is ran in the cloud at a scheduled time (every day / as per the schedule you specify) and then monitor reports are shown which will basically give you the performance metrics and test reports of your APIs.

您可以使用命令行工具 Newman,并将其与您的测试管道集成/人们可以通过多种方式使用 newman.您还可以生成 HTML 报告等.

You can use Newman which is the command line tool and you can integrate it with your test pipeline / there are multiple ways in which people use newman. You can also generate HTML reports etc.

您可以联系邮递员社区获取有关此事的更多帮助.

You can reach out to Postman Community for more help regarding this matter.

这篇关于有什么方法可以在 Postman 中自动化 API 测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 02:12