Jmeter-如何在线程之间共享cookie? [英] Jmeter - How to share cookies between threads?

查看:131
本文介绍了Jmeter-如何在线程之间共享cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Jmeter规范,每个JMeter线程都有自己的"cookie存储区".因此,这意味着我无法使用一个全局(顶级)HTTP Cookie管理器在不同线程之间共享Cookie.

According to Jmeter spec, "Each JMeter thread has its own "cookie storage area". So, it means I can't use one global (top-level) HTTP Cookie Manager to share cookies between different threads.

因此,我知道的唯一解决方案是将cookie存储为属性,并在每个线程的开始处提取它们.

So, the only solution I know is to store cookies as properties and extract them at the beginning of each thread.

问:,是否有其他方法可以在不将cookie存储在文件/属性中的情况下进行同样的操作?

Q: Is there any other way to do the same without storing cookies in files/properties?

推荐答案

据我所知,没有办法在所有线程之间共享cookie.因此,您尝试过的解决方案(手动设置cookie,然后提取它们)应该是唯一的解决方案.

As far as I know, there is no way to share cookies between all threads. So the solution you have tried (to manually set cookies and then extract them) should be the only one.

此处用户问了这个问题, jMeter支持人员通过以下方式回答了该问题:

Here a user asked this question and has been answered this way by jMeter support:

不. JMeter线程旨在代表独立用户,因此cookie 并且变量是线程本地的.

No. JMeter threads are intended to represent independent users, so cookies and variables are local to a thread.

这篇关于Jmeter-如何在线程之间共享cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆