当前位置:网站首页>When are the three tools used for interface testing?

When are the three tools used for interface testing?

2022-06-25 23:31:00 Tian Tian Tian circle

This article will produce , Because there happens to be a project , These two tools are used at the same time , It was the use of tools that freed my hands , Feel what efficiency is 、 Intelligent .

The story background
   The test data of a function module cannot be operated through the interface , To simulate a real test scenario , The developer provides an internal interface document , I hope to reproduce the real use environment through interface calls .
   Here I will talk about the test process and sequence , First, popularize what is Swagger UI.

Swagger UI
  Swagger It's a group of open source projects , Interface documents can be generated automatically online , There is no need to update the interface document frequently , Ensure the consistency of interface documents and codes .
   The real-time update here is one of its advantages . Just imagine , Some companies basically use word Maintain interface documentation , In case of interface change , The document is not updated in time .
   Those who look up this document later exclude the error information , Plus communication time , The cost is too high .
   People are lazy , This happens very often , And I think 80% All of the above will happen .
   that Swagger UI The emergence of the no doubt reflects its advantages .

Using process
   Input interface , Click on try it out.
 Insert picture description here

Check the test results , General display 200 Prove successful call .
 Insert picture description here

Verification process , Check whether the icon appears after the interface corresponding to the page succeeds , Or check that the content value in the database changes .

Think about Mars
   In use , Find out Swagger UI The inconvenience is that the web page opens , Many parameters cannot be saved .
   For example, the same interface may pass several parameters , There is a case of cyclic testing , So every time I call a new parameter , All need to be changed , Very inconvenient , So I thought of Postman.

Postman
   About Postman I won't go into details about how to use it here .
   The general process is to draw a clear picture ,5 Walking : Request mode -> route -> Format -> Parameters -> send out :
 Insert picture description here

Think about Mars
   After several rounds of testing, two problems were found :
  1. I may need to call the same interface several times , Can you just click once ?
  2. Some functions of the whole process can be implemented in sequence , In this way, can I test according to the process ?
   After having this idea, I found that this is JMeter Can it be solved !

JMeter
   Well known ,JMeter The most common use case is to test performance .
   that , The main difference between interface and performance is that when setting the concurrency number, we can change the number to 1, This is equivalent to only one cycle .
 Insert picture description here

Several interface records can be created for the process , adopt enable、disnable Decide which interface to execute when executing .
 Insert picture description here

Configure multiple parameters
   How to implement an interface to call multiple parameters , Here we use the call csv file , Write the parameter contents to csv Just in the file .
   newly build csv Data file settings 、 Choose the path 、 Fill in the parameter name of the call , The parameter names of the following two figures should be consistent .
 Insert picture description here
 Insert picture description here

summary
   Last , Summarize the characteristics of these three interface testing tools in the form of tables :
 Insert picture description here

In the long history of development, human beings have experienced 4 The revolution , At present, we are in the age of 4 The revolution - Intelligent .
   So is the software industry , Keep up with the trend of the times , Finding our own value is our mission and value . The renewal and iteration of technology are the realization that the current tools can not meet the needs of human beings , I believe that one day there will be more JMeter More intelligent tools for testing interfaces .
   If you know a smarter way , Welcome to the bottom message area for discussion ~
  
   Article reprint link http://www.51testing.com/html/81/n-4477681.html

原网站

版权声明
本文为[Tian Tian Tian circle]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251958404517.html