Comparative tests with three connection tools: jmeter + ant; postman; python of requests + unittest or requests + excel

This is a major contrast essay I contacted three types of interface testing tools, from the viewpoint of practical use to analyze the characteristics of each of three kinds of tools

They are: JMeter, Postman, the requests + unittest Python or requests + excel

 1. Using the test interface jmeter

jmeter itself is a java performance testing tool that can be customized send http requests, in accordance with the response result and asserts, the use of some elements can jmeter own interface automated testing.

The general idea is to write a test interface to a csv file, and then build script jmeter one by reading the data in the csv embodiment, binding ant generate test reports, but may be implemented in conjunction with a clock execute scripts jenkins

Features: jmeter itself is a powerful open-source voltage measurement tool, there are many online tutorials related to the use, without secondary development, only for the interface test, it can also achieve the desired effect (can cope with most of our company's Interface testing), learning the basics of cost is not very high;

But writing an interface test is a time-consuming task, since use cases are written in a csv file, if the request is too much argument, it will generate a lot of combinations, to write actually quite strenuous;

If you want more flexibility in the use jmeter, it requires a certain knowledge of java, the use of some of jmeter be aware of the function of the job, this requires in-depth study and practice in their work to do.

Related Essays: https://www.cnblogs.com/hanmk/category/1037987.html

2. Use postman interface test

postman only one thing: the web debug web pages and send HTTP requests, so it is a natural API to do automated testing tools, and many of the company's research and development (whether front-end or back-end) like to work with debugging postman

I study at the beginning of time through the use of detailed postman, and fold became a series of articles were also related to technology sharing within the group (it can be said to be true love, ha ha)

The general idea of ​​using a test interface postman is set so as to create (the Collections) to classify the interface, then the interface subdivided A parameter combination a case where a write request of an interface, the following

If there is a link interface, you can use environment variables be parameterized, flexible use of Pre-request-Script tag and Tests label, you can deal with most of the interface testing requirements, because postman itself is based on written in JavaScript, so you can js scripts to write custom requests (even generate a timestamp or MD5 cryptographic signature )

Features: Tools package is very good, the web debug tool, a single tone interface is very easy; for people without code base, the novice can quickly become familiar with the basic use of postman, learning and low cost; and after learning to use advanced methods responsible for most of the interface testing needs of the company.

But the postman in the batch execution interface generated report does not look good, with Newman + jenkins generated test report more ugly

Related Essays: https://www.cnblogs.com/hanmk/category/1366452.html

 3.python的requests+unittest或requests+excel

 Look at the short introduction

In other words we can use the library to send any requests http requests, including: get request, post the request, put requests, etc., so we can test the interface or web crawler with requests.

I use python respectively own unittest test framework and requests + excel the way the interface unit been tested, our company did not use the main push the code to interface automated testing, this is more of an attempt own, mainly to improve python Application Ability.

特点:对于编程能力强的人,更喜欢自己编写代码来进行接口测试,无论是自己写框架或是借助开源框架再根据业务进行二次开发也好,功能可以定制,用法也比较灵活;

            不过这种方式对个人要求较高,最起码要熟悉一门语言才好。这种方式也很难在整个组推广,因为不可能叫所有人都去写代码,黑盒测试目前也还是不可或缺的(但这是每个测试人员努力的一个方向,成为一个既业务又懂代码的测试人员)。

相关随笔:https://www.cnblogs.com/hanmk/category/1185856.htmlhttps://www.cnblogs.com/hanmk/category/1203663.html

总结

没有最好的测试工具或方法,只有最适合的。根据实际业务情况进行选择就好

Guess you like

Origin www.cnblogs.com/hanmk/p/10970455.html