Charles packet capture tool to set weak network, set breakpoint

Set weak network (slow network speed)

Method 1: Click the turtle logo above Charles to simulate network delay;

 Method 2: Click Proxy——Throttle Settings—check Enable Throttling—then check Only for selected hosts—click Add, set the specified domain name—OK; (simulate weak network for the specified domain name)

breakpoint setting

method one,

Click Proxy——Breakpoint Setting—check Enable Breakpoints—click Add—add the domain name that needs to be placed under the breakpoint—click OK; (When the specified domain name sends a request, it will be intercepted by Charles, and then the request and response can be processed Make changes before releasing ;)

 After clicking Add, enter the domain name to be specified, as shown in the figure below:

Through method 1, make a breakpoint setting example: set a breakpoint for Baidu search

1. The original request was to search for: cat 

2. Set a breakpoint for Baidu's domain name in charles

3. After sending a search: cat request, Charles intercepts Baidu’s request request data, then edits the request request data, and then clicks Execute to execute; as shown below

4. The data returned by the server will also be intercepted by charles, and the operation of modifying the response can be performed, and then click Execute to execute. As shown below:

Method two,

  After finding the requested data packet in the session list, right-click—Breakpoints to set a breakpoint for a certain request data packet ( instead of setting a breakpoint for the entire domain name )

1. Search Baidu in charles: set a breakpoint for the entire request packet of giant panda, as shown in the figure below

 2. After refreshing (sending) a search: giant panda's request, Charles intercepts the request packet, changes the giant panda to wild goose, and then clicks Execute. As shown below

 3. Check the search on the webpage: the giant panda page becomes the page for searching wild geese, as shown in the figure below

Note: (This method only sets a breakpoint for a certain resource of the request packet , so after release, the data returned by the server will not be intercepted )

Practical case

Optical theory is useless, you have to learn to follow along, and you have to do it yourself, so that you can apply what you have learned to practice. At this time, you can learn from some practical cases

If it is helpful to you, please like and collect it to give the author an encouragement. It is also convenient for you to quickly find it next time.

If you don’t understand, please consult the small card below. The blogger also hopes to learn and progress with like-minded testers

At the right age, choose the right position, and try to give full play to your own advantages.

My road of automated test development is inseparable from the plan of each stage along the way, because I like planning and summarizing,

Test and develop video tutorials, study notes and receive portals! ! !

Guess you like

Origin blog.csdn.net/Liuyanan990830/article/details/129733299