The company’s new project team developed a wechat small program e-commerce platform. In order to better ensure product quality, interface testing was proposed.

In terms of the interface itself, testing it should be the same as any other project. So it is not difficult to understand that we need to prepare for the small program interface test

Materials are:

1. Complete interface documentation (what is a complete interface documentation, as described in the previous article, will not be classified here)

2, the selection of test tools (Jmeter/ Postman/or directly? Here I will explain jMeter

3, packet capture tool, better analysis of data reversal

OK, the preparation work is complete, now we capture the small program

I. Open the small program and grab the login interface as shown in the picture below:

Figure (1) shows the interface calling server and calling address

Figure 2 shows interface request parameters and interface return values

2. Configure the interface in JMeter according to the captured parameters, as shown in the figure below:

2.1 JMeter request configuration, as shown below

Description: configuration OK, ecstatic, jubilant, think everything is OK

2.2 Execute the script to view the returned result, as shown below:

If software testing, interface testing, automated testing, performance testing, LR script development, interview experience exchange. If you are interested, you can go to 175317069. There will be free information links in the group from time to time, which are collected and sorted out from various technical websites. If you have good learning materials, you can send them to me privately.

MMP ah, generally login interface is not put in the request parameters will be able to login successfully? Here, open the applet several times by capturing the packet to discover the request parameters in the login interface

Values (” code “:” 061 xam5b2hjcfp0bnn5b2fl15b2xam5e “) he she it is will be, of course there is nothing wrong with this also.

Analyze and obtain the code value

3.1 according to the error information in 2.2, we can know that the login interface of the small program is actually the login state of calling wechat

3.2 Which party gave us the code value? (Case by case analysis)

Parsing: Because the small program is directly jumped into wechat, so the login state of the small program is actually directly obtain wechat login state, so the code is wechat

Pass to our applet

3.3. How to obtain the code value?

3.3.1 from the perspective of development, directly call the API interface provided by wechat (not explained here)

3.3.2. Grab the code through wechat developer tools and fill it into the login interface. The method to grab the code value (which can be communicated with the developer) is mine

The method is shown in the figure below:

4. Put the value of the obtained code into the login request and initiate the request again, as shown in the picture below:

Change often comes quietly, growth does not happen overnight