How to do breakpoint testing? This article teaches you how to use Charles tools for interface testing!

During the testing process, we often set a breakpoint in a certain line or link of the program. During the program request process, we modify the parameters, requests or responses at the breakpoint to locate the problem. This is the so-called breakpoint. Point test. This type of breakpoint testing is mainly used for interface testing.

Breakpoint testing can easily locate front-end or back-end problems by viewing the data returned by the interface. At the same time, it is easy to construct test data by changing the request and response data.

In short, breakpoint testing can locate problems faster by modifying interface data. This is a commonly used method for testing.

Preface

How to do breakpoint testing with Charles tool

Charles packet capture tool can easily implement breakpoint testing.

The specific implementation steps are as follows:

Step 1: Enable breakpoints

Click the breakpoint button in the tool menu bar, as shown in the figure below, to start the breakpoint function.

Or start breakpoint setting in proxy --> breakpoint setting -->:

Step 2: Add the target interface to the breakpoint configuration

  1. Start packet capture first and capture the corresponding request;

2. Right-click the request and select "Breakpoints" to add this interface to the breakpoint configuration:

In this way, the configuration of this interface will be added to the proxy's breakpoint settings; if you access this interface again next time, the breakpoint will be triggered.

Note here: After adding a breakpoint to each interface, both the requests message and the response message will trigger this breakpoint by default.

现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:110685036

Step 3: Request a breakpoint

When the browser initiates this interface request again, the breakpoint will be triggered. A new window will pop up in the Charles tool, which is the page of the breakpoint. This is the breakpoint triggered by the request message, and the request message is also displayed:

4. Click Edit requests to modify the request message, then click "Execute" to execute the request and view the results displayed on the page:

After editing the request message, click "Execute" and the modified request message will be sent to the backend; for example:

Suppose the value of the page parameter is changed to "2". After clicking Execute, you can see the corresponding effect on the page, which is displayed as the data of the second page:

Step 4: Respond to breakpoints

If the response message is also configured in the breakpoint settings, the response message will also trigger the breakpoint, and the breakpoint page will display the response information:

Then you can edit the response message in the "Edit Response" page, for example, delete the contents of the response message, and then click "Execute":

You can see the corresponding result display simultaneously on the page, without data display.

Finally, I would like to thank everyone who has read my article carefully. Looking at the increase in fans and attention, there is always some courtesy. Although it is not a very valuable thing, if you can use it, you can take it directly!

Software Testing Interview Document

We must study to find a high-paying job. The following interview questions are from the latest interview materials from first-tier Internet companies such as Alibaba, Tencent, Byte, etc., and some Byte bosses have given authoritative answers. After finishing this set I believe everyone can find a satisfactory job based on the interview information.
 

Insert image description here

Guess you like

Origin blog.csdn.net/m0_58026506/article/details/133082304