5

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?

j0k
  • 22,600
  • 28
  • 79
  • 90
Jiman
  • 185
  • 2
  • 13

2 Answers2

1

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.

Jiman
  • 185
  • 2
  • 13
0

Take a look at jMeter Plugins' InterThreadCommunication.

With it you can put a string value into a global parameter queue from one thread, and then get that value from another thread, even in a different thread group.

Marko Bonaci
  • 5,622
  • 2
  • 34
  • 55
  • Thanks, but do you have any suggestions on how I could use this with my HTTP URL Re-writing Modifier? It has no input for variables. – Jiman Oct 09 '12 at 15:04
  • 1
    Can you explain why do you need to sync sessionid between different users. – Marko Bonaci Oct 11 '12 at 14:54
  • More specifically, which real-world event are you trying to emulate with that? – Marko Bonaci Oct 11 '12 at 18:03
  • And can you please explain why do you need both cookies and URL rewriting? URL rewriting is normally used as the fallback for situations when cookies aren't available (e.g. disabled in browser). – Marko Bonaci Oct 11 '12 at 18:10
  • Basically, it's a test case to cover an 'impatient user' that sends multiple identical requests at once. – Jiman Oct 12 '12 at 14:48