Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter - Share Session Between Thread Groups

I'm fairly new to JMeter; I have been searching for a way to share a session id between HTTP Requests within concurrently executing Thread Groups. I checked over the other questions, but they don't seem to deal with sessions, and I already accomplished my goal of sharing CSV vars between threads.

My Test Suite structure:

Test Plan
- HTTP Cookie Manager
- CSV Data Set (sharing mode: all threads)
- HTTP URL Re-Writing Modifier (session arg name: jsessionid, caches session id)

- Thread Group 1
---Controller
------HTTP Request (uses csv value)

...

- Thread Group N (duplicates of TG 1)
---Controller
------HTTP Request (uses csv value)

This is the flow that my Test Plan takes (as seen by a View Results Tree Listener):

HTTP Request (TG 1-1) CSV Value: (1) *caches session id, let's say 123
...
HTTP Request (TG N-1) CSV Value: (1) *caches different session id, let's say 456
HTTP Request (TG 1-2) CSV Value: (2) jsessionid=123
...
HTTP Request (TG N-2) CSV Value: (2) jsessionid=456

My goal is to send a number of identical requests with the same session id at once. As you can see, they are identical aside from the session id. What can I do to fix this?

like image 805
Jiman Avatar asked Nov 13 '22 21:11

Jiman


1 Answers

A rather unfortunate, manual solution:

Grab a session id manually, put it into a user defined variable, append session variable to urls within my HTTP Requests without a HTTP URL Re-writing modifier.

like image 184
Jiman Avatar answered Dec 19 '22 12:12

Jiman