当前位置:网站首页>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"
边栏推荐
猜你喜欢
Practical skills: a key for image information in the Harbor, quick query image
JDBC中的增删改查操作
Ontology development diary 04 - to try to understand some aspects of protege
文件操作
try catch 对性能影响
时间复杂度和空间复杂度
Super detailed MySQL basic operations
Sweet alert
[ASM] Bytecode operation MethodVisitor case combat generation object
m个样本的梯度下降
随机推荐
Sweet alert
《刷题日记》2
7.FileFilter interface
4.字符流
Openwrt配置Aria2(Hg255d)
Ontology development diary 02 - simple sparql query
Redis 缓存主动更新策略
1.流的概念
3.编码方式
循环嵌套以及列表的基本操作
Browser error classification
5.转换流
cannot import name ‘load_offloaded_weights‘ from ‘accelerate.utils‘ (/home/huhao/anaconda3/envs/huha
Ontology Development Diary 05-Strive to Understand SWRL (Part 2)
Go-goroutine 的那些事
vgg网络结构
5. Transform Streams
Apache Log4j 2 远程代码执行漏洞详解
8.Properties属性集合
mac 上安装Redis和配置