当前位置:网站首页>Technology Sharing | How to simulate real usage scenarios?mock technology to help you
Technology Sharing | How to simulate real usage scenarios?mock technology to help you
2022-08-09 09:58:00 【Tester_muller】
Mock is a tool that modifies requests and responses through proxies to assist in constructing more application scenarios.For example, at work, it may be necessary to mock third-party callbacks to the tester's testing environment, so as to carry out the test work more smoothly and make the test environment closer to the real usage scenario.
Charles Modification Request and Response
MapLocal
Redirect the specified network request to a local file.
1. First save the data returned by the interface, right-click an interface -> click SaveResponse -> select html format
2. Modify the local html and change "Baidu Yiyi" to "Hogwarts"
3. Set charles to map local, right click on Map Local-> enter Edit Mapping -> click choose -> select the modified html-> click OK
4. At this time, if you request Baidu again, you can see that "Baidu" has changed to "Hogwarts"
In the Charles menu, select Tools->Map Remote or Map Local to enter the setting page of the corresponding function.
MapRemote
is to redirect the specified network request to another URL request address.
- Set parameters Toos->Map Remote
- Check the access results, you will find that www.baidu.com will be redirected to www.sougou.com
Rewrite function
The Rewrite function is suitable for some regular replacement of a certain type of network request to achieve the purpose of modifying the result.
- Open Tools->Rewrite, replace the content, and replace "My Concerns" in the page with Hogwarts
- Apply to Baidu again, again, "My Concern" has become "Hogwarts"
边栏推荐
猜你喜欢
随机推荐
7.FileFilter接口
8.Properties属性集合
KeyBERT和labse提取字符串中的关键词
借问变量何处存,牧童笑称用指针,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang类型指针(Pointer)的使用EP05
4.字符流
自定义类型:结构体,枚举,联合
2021-04-26QGIS3.10加载天地图影像(地图瓦片)的一种方法
【ASM】字节码操作 MethodVisitor 案例实战 生成对象
Ontology development diary 04 - to try to understand some aspects of protege
Thread,Runnable,ExecutorService线程池控制下线程量
6.Map interface and implementation class
8. Recursively traverse and delete cases
日期操作比较全面得代码
慕课网-简易扑克牌游戏 思路清晰 简易版
超详细的MySQL基本操作
【八大排序③】快速排序(动图演绎Hoare法、挖坑法、前后指针法)
类 对象 属性 方法 类的成员
Go-goroutine 的那些事
归并排序
快速解决MySQL插入中文数据时报错或乱码问题