Вопрос

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?

Это было полезно?

Решение

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.

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top