当前位置:网站首页>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"
边栏推荐
猜你喜欢
随机推荐
3.List接口与实现类
浏览器的报错分类
Win系统 - 罗技 G604 鼠标蓝灯闪烁、失灵解决方案
1. The concept of flow
STM32F103实现IAP在线升级应用程序
BigDecimal用法常用操作记录
7.FileFilter接口
3.List interface and implementation class
Redis 回击 Dragonfly:13 年后,Redis 的架构依然是同类最佳
拿下跨界C1轮投资,本土Tier 1高阶智能驾驶系统迅速“出圈”
Go-goroutine 的那些事
Ontology Development Diary 03-Understanding Code
MySQL索引、视图、设计三范式,通俗易懂,不可错过!
try catch 对性能影响
五个不同事物隔离级别,七个事物传播行为
2. Thread creation
1. Introduction to threads
【个人学习总结】CRC校验原理及实现
Source GBase database, oracle quote "ORA - 01000: beyond the shop open the cursor"
2. Byte stream