当前位置:网站首页>Technology sharing | how to simulate real use scenarios? Mock technology to help you
Technology sharing | how to simulate real use scenarios? Mock technology to help you
2022-07-28 06:52:00 【Yehna rahmin】
mock It is a kind of modifying request and response through proxy , So as to assist in the construction of more application scenarios . For example, at work , You may need to mock The callback of the third party is given to the testing environment of the tester , So as to carry out the test work more smoothly , It also makes the test environment closer to the real use scenario .
Charles Modify request and response
MapLocal
Redirect the specified network request to the local file .
Save the data returned by the interface first , Right click an interface -> Click on SaveResponse -> choice html Format
To the local html Make changes , take “ use Baidu Search ” Change it to “ Hogwarts ”
Set up charles Conduct map local, Right click on the Map Local-> Get into Edit Mapping -> Click on choose -> Select the modified html-> Click on OK
At this time, ask Baidu again , You can see “ use Baidu Search ” Change into “ Hogwarts ”

stay Charles On the menu , choice Tools->Map Remote or Map Local You can go to the corresponding function setting page .
MapRemote
Redirect the specified network request to another URL request address .
1. Set parameters Toos->Map Remote

2. View access results , Will be found ,www.baidu.com Will be redirected to www.sougou.com
Rewrite function
Rewrite The function function is suitable for some regular replacement of a certain kind of network request , To achieve the purpose of modifying the result .
1. open Tools->Rewrite, Replace the content , Let's put... On the page “ My attention ” Replace with Hogwarts

2. Apply for Baidu again , Again ,“ My attention ” Change into “ Hogwarts ”
Recommend learning
「Python App Automated testing training camp 」 Comprehensive upgrading , Senior Test Development Engineer will take you from 0 To 1 Quick start APP automated testing , Scan the code to get course materials ~

边栏推荐
- 测试面试题集锦(二)| 测试工具篇(附答案)
- About the collation of shader keyword
- What's a good gift for Tanabata? Niche and advanced product gift recommendation
- Ready to start blogging
- Redis implementation of distributed lock and analysis of the main process of redismission distributed lock
- 单元测试框架Jest搭配TypeScript的安装与配置
- Initializingbean interface and examples
- QGraphicsView提升为QChartView
- C language memcpy library functions and the role of memmove
- JS四则运算重新封装,解决精度丢失问题
猜你喜欢

Explain in detail

rancher部署实战

How to calculate the size of structure, segment and Consortium (common body)

Water bottle effect production

Mongo SSL configuration practice
![[c language] - step by step to achieve minesweeping games](/img/ee/49ddfcd948ccd5c8c9dec3c48c6112.png)
[c language] - step by step to achieve minesweeping games

Which is the best one to make air conduction headphones? Inventory of the best air conduction headphones

MySQL master-slave

SSAO by computer shader (II)

项目编译NoSuch***Error问题
随机推荐
prometheus监控nacos
Initializingbean interface and examples
HDU-2036-改革春风吹满地(多边形面积模板)
Ubuntu18.04搭建redis集群【学习笔记】
Redis cache design and performance optimization
Ready to start blogging
什么是线性表?
等保3.0-服务器三权分立配置
Dynamic memory management function of C language
CentOS7部署MySQL数据库服务器
网络——传输层(详细版)
iptables防火墙
MySQL主主
Centos7 deploy MySQL database server
单项链表的创建、遍历以及按要求查找结点
How to simulate the implementation of strcpy library functions
feignclient @RequestMapping参数设置及请求头简易方式设置
Compilation and preprocessing of C language
Graphic pipeline foundation (II)
[hash table basics]