[Interface Test] Postman (1)--Interface Test Knowledge Preparation _

1.0 Preface

Application Programming Interface (API) is one of the most popular technologies in recent years. Powerful web applications and leading mobile applications are inseparable from powerful back-end APIs. The application of API technology brings convenience to system development, but it also places higher requirements on testers. How to test these APIs in an effective way and ensure that they run as expected is the main problem currently faced by testers. .

Today we will briefly introduce some concepts of interface testing and some professional terms, etc.

1.1 Interface testing concept

1.1 Interface testing

​Interface testing is a test that tests the interfaces between system components. Interface testing is mainly used to detect interaction points between external systems and systems and between internal subsystems. The focus of testing is to check the exchange of data, transmission and control management processes, as well as the mutual logical dependencies between systems, etc.

1.2 Principles of interface testing

​ The tester uses auxiliary tools to simulate the client sending a request message to the server. After the server accepts the request message, it processes the corresponding message and returns a response to the client. The tool simulates the client to accept the response, and then the tester Check whether the response is accurate

1.4 Common interface testing tools

  • Postman
  • Jmeter
  • eolinker
  • doclever
  • test

Here we use Postman

1.2 Basic knowledge of interface testing

1.2.1 Definition of interface

As the name implies, an interface is to connect two different systems or two different functions in one system. The interconnected parts between them are called interfaces.

1.2.2 Classification of interfaces

(1) HTTP interface

​ It is an interface developed based on Hypertext Transfer Protocol (HTTP), but it does not exclude the use of other protocols.

(2) Web Service interface

​ It is the external interface of the system. For example, if you want to obtain resources from other websites or servers, generally speaking, others will not share the database with you. They will provide a method written by them for you to obtain data. , you can reference the interface they provide by using the method they wrote, so as to achieve the purpose of synchronizing data.

(3) RESTful interface

​Referred to as REST, it describes an architectural style network system with the core being resource-oriented. REST specifically targets network application design and development methods, reducing the complexity of development and improving the scalability of the system.

1.2.3 HTTP request

​ HTTP request contains four parts: Uniform Resource Locator (URL), method (Method), headers (Headers) and body (Body)

1 Uniform Resource Locator (URL)

Everyone should be familiar with URLs, so we won’t waste space here and just skip it.

2 Method

​ Here are instructions in 1.3 of the blogger’s previous performance testing knowledge preparation post. Please check it out.

3 Header and Body

HTTP messages are text-oriented. Each field in the message is an ASCII code string, and the length of each field is uncertain. The HTTP request message consists of four parts: request line, header, blank line and request data. The general format of the request message is as follows.

http

<request-line>
<headers>
<blank line>
[<request-body>]

1.2.4 HTTP response

After sending the HTTP request to the server, the server will give a corresponding response. The response message returned by the server is called an HTTP response.

1 HTTP response message

The HTTP response message consists of three parts: status line, message header and response body . The format of the HTTP response is very similar to the format of the request. The format is as follows:

http

<status-line>
<headers>
<blank line>
[<response-body>]

The status line format is HTTP-Version Status-Code Reason-Phrase CRLF

  • HTTP-Version****: Server HTTP version
  • Status-Code: Response status code returned by the server
  • Reason-Phrase: A textual description representing the status code
  • CRLF: represents a carriage return character and a line feed character

2 JSON

(1) Definition of JS object tag

​JS Object Notation (JSON) is a lightweight data exchange format. It is based on a subset of ECMAScript (the JavaScript specification developed by the W3C) and uses a text format that is completely independent of coding languages ​​to store and prompt data. The brief introduction and clear hierarchical structure make JSON an ideal data exchange language. It is easy to read and write, easy to parse and generate by machines, and can effectively improve network transmission efficiency. Therefore, HTTP interface responses are generally in JSON format.

(2) JSON syntax rules

​ JSON syntax rules include using curly brackets to save objects, using key-value pairs to represent objects, using commas to separate each object, and using square brackets to save arrays.

(3) JSON example

json

{"name": "storm", "age": "32", "sex": "male"}

As for the download and installation of Postman, just download and install it directly from the official website, and install it silently.

This is our simple knowledge preparation

The above is the entire content of this section. If there are any errors, please correct me!

 


Finally, I will share with you the documents and learning materials that I have accumulated and truthful. If necessary, you can just pick them up. The above content should

be the most comprehensive and complete preparation warehouse for software testing friends. In order to better organize it For each module, I also referred to many high-quality blog posts and projects on the Internet, trying not to miss any knowledge point. Many friends relied on these contents to review and got offers from major manufacturers such as BATJ. This warehouse has also helped a lot. As a learner of software testing, I hope it can also help you.

Follow my WeChat public account below to get it for free↓ ↓ ↓ ↓ ↓

Guess you like

Origin blog.csdn.net/weixin_54696666/article/details/132818211