The most detailed in the whole network, Fiddler modify the interface to return data detailed steps in actual combat, assisting interface testing...


foreword

In the process of testing, some requirements are like this. It requires you to modify the data returned by the interface to check whether it is displayed correctly in the client mobile app. This is also a kind of interface fault tolerance test, and the interface fault tolerance test belongs to app performance ( One of the special) tests.

Through Fiddler, we can modify the returned results in several ways:

Type 1:
In the black command line display area at the bottom of Fiddler, press Enter in the form of bpu url to intercept, and access the specified interface through the mobile app. After intercepting, you can select the response file and pass the interception;

Type 2:
Add Rule in AutoRespnder, and then set the response content in Rule Editor;

Type 3:
Select After Responses in Automatic Breakpoints in the Rules settings to intercept.

The first type cannot create a custom response, and can only specify the response by selecting a file. The third type intercepts all requests, which is too rough and too general. Therefore, in the actual test interception request, the most flexible and powerful one is the second one.

Type 2 detailed steps

The following is the whole process of the interception method to capture and modify packets:
1. Capture packets, find the request to be intercepted, and then add Rule in AutoResponder:

A1

2. Select "Create New Response..." in the second column of the Rule Editor:

A2

3. Click Save, a window will pop up, select the Raw column in the pop-up window, copy and paste the content of the Raw column corresponding to the request captured by the packet capture, and then modify the part you want to modify, and then click "Save" To save:

A3

After that, the request can be automatically intercepted and the return body can be modified.

4. If you want to frequently modify and replace some content in the returned body, you can right-click on the corresponding request to be intercepted in AutoResponder, "Edit Response" to edit the returned body:

A4

If you want to be more convenient, you can right-click on the corresponding request to be intercepted in AutoResponder, "Generate File" to save the response body to a local txt file, and then open the txt file to modify and save it to take effect.

But note that if you save the response content in a file, there may be errors in client processing caused by encoding problems. The most recommended way, the way that will not go wrong, is through the "Create New Response..." method:

A5

The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled

1. From entry to mastery of Python programming

Please add a picture description

2. Interface automation project actual combat

Please add a picture description

3. Actual Combat of Web Automation Project

Please add a picture description

4. Actual Combat of App Automation Project

Please add a picture description

5. Resume of first-tier manufacturers

Please add a picture description

6. Test and develop DevOps system

Please add a picture description

7. Commonly used automated testing tools

Please add a picture description

Eight, JMeter performance test

Please add a picture description

9. Summary (little surprise at the end)

Life is like a journey, struggle is the compass for moving forward, and persistence is the source of power for climbing. Believe in yourself and venture out bravely. Only by constantly challenging yourself can you surpass yourself. Let fly the wings of the soul, fight hard to embrace the light, and march towards the brilliant stage of life! Work hard and achieve extraordinary results!

Passion burns the heart, perseverance drives struggle, and every step is a footstep towards success. Don't be afraid of setbacks and difficulties, water your achievements with sweat, and write your own glorious chapter.

Pull up the mountains and rivers, shine on the stars, and strive to create extraordinary legends. Down-to-earth, dreams are sailing, and only by paying can we bloom brilliantly. Fly against the wind, cross the mountains, go forward bravely, and create your own glorious chapter! Keep fighting and light up the future!

Guess you like

Origin blog.csdn.net/shuang_waiwai/article/details/132130816