How to do breakpoint testing, this article teaches you how to use Charles tools to do 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.

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.

picture

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

picture

Step 2: Add the target interface to the breakpoint configuration

Start packet capture first and capture the corresponding request;

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

picture

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.

picture

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

Step 3: Request a breakpoint

When the browser makes 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:

picture

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

picture

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:

picture

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:

picture

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":

picture

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

picture

Finally: The complete software testing video tutorial below has been compiled and uploaded. Friends who need it can get it by themselves [guaranteed 100% free]

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.

Guess you like

Origin blog.csdn.net/weixin_50829653/article/details/133041162