Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How should newcomers use postman

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how to use postman, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

First, understand postman1. What is postman?

-A tool used by software testing to do interface testing.

two。 How to download postman

-https://www.getpostman.com/ (official download) or local download

3. Postman interface

Second, how to use postman tools to test 1. Common methods of interface requests (GET/POST)

1.1 differences between GET and POST

① length. GET has a length limit, and POST has no length limit.

② security. GET usually displays the parameters in the URL address, which can be seen, which is not so secure, while POST writes the parameters to the body, which cannot be seen, so it is more secure.

③ action. GET is usually used to read data from the database; POST is to submit / update the data in the database.

1.2 GET method testing

1.2.1 GET method with no parameters

1.2.2 GET method with parameters

1.3 POST method testing

User registration

User login

The difference between session, cookie and token

Reprint-> differences between cookie, session and token

Summary: both cookie and session are used to store users' data and information, so cookie is stored locally, which is less secure than session; session is stored on the server side and has security, but the performance will be degraded when the amount of data is large. Token is the equivalent of a token and can be stored locally.

two。 Use token to operate

User login

Users need to post inspiration after logging in.

2.1 Parameterization-set common data as parameters to make it easier to use common data / associations

-it is too troublesome to enter a corresponding URL address for each new interface. Can it be simplified?

-set parameterization to write common data to the global / local variable environment, using the variable name.

At this point, I add the URL address as a local variable

2.2 Custom script (JS script)

-how do I automatically get the token value and automatically write the token value to the local variable?

-you can customize the script.

2.3 assertion-automatic judgment of success

2.4 simple automated testing

-> after each interface is set to assert

The order of my choice is

The content of the final result

Matters needing attention in interface testing

1. Interface testing tools are always tools, and the important part is the writing of test cases.

two。 Interface test cases are gradually developed from both positive and reverse aspects, and test cases need to be designed according to specific requirements.

3. For the data written to the database, go to the database to see if it has been written properly; for the interface of the query class, you need to go to the database to see if the data is consistent.

4. Before writing use cases, you need to be familiar with the requirements of the entire system and the database; in addition to testing each interface, you also need to test the interfaces associated with the business logic.

The above is how newcomers should use postman. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report