当前位置:网站首页>How to extract login cookies when JMeter performs interface testing
How to extract login cookies when JMeter performs interface testing
2022-07-06 06:16:00 【The elegance of testing】
use JMeter When carrying out interface test , It is often necessary to extract Cookie To carry out other business processes , If cookie/token It is in the response message of login request , Then it can be extracted directly through regular expressions , But if Cookie Not in the response message , How else can we extract it ?
Through analysis, we found that , The request header of the business interface contains Cookie value , You need to get it through the login interface Cookie Then it is passed to the request header of other interfaces .
Add HTTP Cookie Manger, You can see Cookie value .

To put Cookie Stored as a variable , First of all, we need to /bin Under the table of contents jmeter.properties Of documents “#CookieManager.save.cookies=false” It is amended as follows “CookieManager.save.cookies=true” And remove the notes “#”.


Add HTTP Cookie Manager , And add user-defined Cookie, Set the name here as aaa, The value is ${COOKIE_aaa}.

stay HTTP Request header manager , Here you need this Cookie Used where the value is ${COOKIE_aaa} Express , That is to say :

In subsequent requests , You can see that the request header contains the passed Cookie value .
Last : It can be in the official account : Sad spicy bar ! Get one by yourself 216 Page software testing engineer interview guide document information 【 Free of charge 】. And the corresponding video learning tutorial is free to share !, It includes basic knowledge 、Linux necessary 、Shell、 The principles of the Internet 、Mysql database 、 Special topic of bag capturing tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance testing 、 Safety test, etc. .
I recommend one 【Python Automated test communication group :746506216】, We can discuss communication software testing together , Learn software testing together 、 Interview and other aspects of software testing , Help you advance quickly Python automated testing / Test Development , On the road to high pay .
Friends who like software testing , If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One Key triple connection !
边栏推荐
猜你喜欢

Significance of unit testing

The latest 2022 review of "graph classification research"
![Buuctf-[bjdctf2020]zjctf, but so (xiaoyute detailed explanation)](/img/c9/56fba6054c91f090de31463a8b4705.jpg)
Buuctf-[bjdctf2020]zjctf, but so (xiaoyute detailed explanation)

LeetCode 729. 我的日程安排表 I

D - How Many Answers Are Wrong
![[API interface tool] Introduction to postman interface](/img/03/c1541fca65dd726fd4bdc8793b605e.png)
[API interface tool] Introduction to postman interface

D - How Many Answers Are Wrong

【Postman】Monitors 监测API可定时周期运行

使用Nacos管理配置
![Buuctf-[[gwctf 2019] I have a database (xiaoyute detailed explanation)](/img/2c/43ce298794589c5282edda94161d62.jpg)
Buuctf-[[gwctf 2019] I have a database (xiaoyute detailed explanation)
随机推荐
全链路压测:构建三大模型
技术分享 | 常见接口协议解析
Reading notes of effective managers
多线程应用的测试与调试
Properties file
CoordinatorLayout+NestedScrollView+RecyclerView 上拉底部显示不全
Manhattan distance sum - print diamond
调用链监控Zipkin、sleuth搭建与整合
通过修改style设置打印页样式
【Postman】测试(Tests)脚本编写和断言详解
Configuring OSPF GR features for Huawei devices
[web security] nodejs prototype chain pollution analysis
自定义指定路由上的Gateway过滤器工厂
P问题、NP问题、NPC问题、NP-hard问题详解
曼哈顿距离和-打印菱形
[postman] dynamic variable (also known as mock function)
异常检测方法总结
About PHP startup, mongodb cannot find the specified module
LeetCode 731. 我的日程安排表 II
在线问题与离线问题