当前位置:网站首页>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 !
边栏推荐
猜你喜欢
随机推荐
还在为如何编写Web自动化测试用例而烦恼嘛?资深测试工程师手把手教你Selenium 测试用例编写
ESP32 ESP-IDF看门狗TWDT
公司视频加速播放
调用链监控Zipkin、sleuth搭建与整合
IDEA 新UI使用
[ram IP] introduction and experiment of ram IP core
单元测试的意义
Interface test: what are the components of the URL in fiddler
测试周期被压缩?教你9个方法去应对
IPv6 comprehensive experiment
自定义指定路由上的Gateway过滤器工厂
Redis 核心技术与实战之 基本架构:一个键值数据库包含什么?
Amazon Engineer: eight important experiences I learned in my career
What are the test sites for tunnel engineering?
php使用redis实现分布式锁
【LeetCode】Day96-第一个唯一字符&赎金信&字母异位词
Cannot create PoolableConnectionFactory (Could not create connection to database server. 错误
Pat (Grade B) 2022 summer exam
假设检验学习笔记
LeetCode 1200. 最小绝对差


![[untitled]](/img/5d/028b9d19e9a2b217f40198d4631db2.png)


![Buuctf-[bjdctf2020]zjctf, but so (xiaoyute detailed explanation)](/img/c9/56fba6054c91f090de31463a8b4705.jpg)



