One, the preparation of the interface test
1. Interface test tools: APIPost, Jmeter, etc
2. Interface document. If there is no interface document, use the interface information acquisition tool
3. Interface information collection tools: Fiddler packet capture tool, Browser developer tool (F12), etc
Second, the Web interface test needs to capture things
Three things you need to know about Web interface testing
1. Request modes include GET, POST, PUT, Patch, and DELETE
2. Url: includes HTTP request and HTTPS request, for example, www.baidu.com and www.baidu.com
3. Body parameters are generally passed in JSON format, for example,” name”:”xiaoming”,” PWD “:”123”. Generally, post is used to pass parameter requests.
3. Fiddler packet capture tool
Fiddler is one of the most powerful free web debugging tools developed by C#. It can log HTTP and HTTPS requests from all clients and services, monitor breakpoints, and even modify input and output data. It also includes a powerful event-based scripting subsystem. And can be extended using.net language.
Fiddler is the interface we use to crawl web pages. After fetching, according to the above requirements of the request method, URL and body to find the required data.
This is a simple login request captured by Fiddler, we can use the following information:
Protocol Request type: HTTP or HTTPS. Here is the HTTP
2. Host + URL Specifies the interface access address. The requested address is 127.0.0.1:8888/login
3.Request methods in Request Haeders include get and POST. Here’s the POST request
Next click on WebForms to check the body parameters.
Parameter name: parameter value, name:xiaoming, PWD :111
4. Interface test
After receiving the detailed information of the interface through fiddler, we tested the interface using apipost.
Select request method post, address: http://127.0.0.1:8888/login and the parameters of the body: name: xiaoming, PWD: 111
Viewing request Results
This is how interface testing is done with Fiddler and APIPost.
Fiddler can be downloaded from:
[www.telerik.com/fiddler​
www.telerik.com
] (link.zhihu.com/?target=htt…).
Apipost download address:
ApiPost – API debugging and management tool that can generate documents directly
www.apipost.cn! [] icon (https://p3-juejin….