我在 jmeter 中有一个测试计划,其中包含 setUp、tearDown 和一个主线程。
setUp thread logins the application (open a session).
main thread executes to perform a task in same session.
tearDown thread logout the application (close the session).
这是不可能的,因为设置线程的cookie不能在其他线程中使用,所以我们无法在其他线程中获取 session 。
请告诉我这是怎么可能的?
感谢您的帮助。
最佳答案
您可以使用 Inter-Thread Communication 在线程组之间共享数据(包括 cookie)
但是我不明白你为什么要这样做。我建议这样做:
Thread Group
HTTP Sampler (login)
.
Put your logic here. Maybe you need Loop Controller or Synchronizing Timer here
.
HTTP Sampler (logout)
关于testing - JMeter:如何在多线程中处理cookies?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14139074/