You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Alaka P A <al...@gmail.com> on 2013/03/11 12:48:13 UTC

Persist JSESSIONID throughout a TestPlan

I have to test the webserver which has to maintain sessions. 
For this purpose I need to maintain session ids in jmeter. 
It has been working for ThreadGroup as I 
am using HTTP Cookie Manager for every Thread Group. 
But i want to use the same 
JSESSIONID across the test plan which includes several Thread Groups. 
Not able to achieve this. 
I tried using HTTP Cookie Manager globally for a Test Plan, 
But it didnt work.
I am using jmeter 2.5 version. Can anybody help me with this?
Thanks !


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Persist JSESSIONID throughout a TestPlan

Posted by waseemfa <fa...@gmail.com>.
There is no simple way to pass values through out thread groups in JMeter as
far as I know.  You can do the following to achieve your problem.

Extract the value you want using Regex extractor into a variable say
"variablevalue" and set the same into property
${__setProperty(variablename, ${variablevalue})};

In the consequent thread group where you want to use the value just call it
by 
${__property(variablename)}

This should solve your problem

-Waseem



--
View this message in context: http://jmeter.512774.n5.nabble.com/Persist-JSESSIONID-throughout-a-TestPlan-tp5716314p5716359.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Persist JSESSIONID throughout a TestPlan

Posted by Niraj <ni...@gmail.com>.
You can extract JSession ID using regular expression and then add that in
your next subsequent thread groups. I haven't tried this but i guess it
should work.

On Mon, Mar 11, 2013 at 5:18 PM, Alaka P A <al...@gmail.com> wrote:

> I have to test the webserver which has to maintain sessions.
> For this purpose I need to maintain session ids in jmeter.
> It has been working for ThreadGroup as I
> am using HTTP Cookie Manager for every Thread Group.
> But i want to use the same
> JSESSIONID across the test plan which includes several Thread Groups.
> Not able to achieve this.
> I tried using HTTP Cookie Manager globally for a Test Plan,
> But it didnt work.
> I am using jmeter 2.5 version. Can anybody help me with this?
> Thanks !
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Persist JSESSIONID throughout a TestPlan

Posted by sebb <se...@gmail.com>.
On 11 March 2013 11:48, Alaka P A <al...@gmail.com> wrote:
> I have to test the webserver which has to maintain sessions.
> For this purpose I need to maintain session ids in jmeter.
> It has been working for ThreadGroup as I
> am using HTTP Cookie Manager for every Thread Group.
> But i want to use the same
> JSESSIONID across the test plan which includes several Thread Groups.
> Not able to achieve this.

But why do you want to share sessions across thread groups?
Surely these sessions are intended to represent individual browsers?
Different JMeter threads represent different users; each should have
its own session.

> I tried using HTTP Cookie Manager globally for a Test Plan,
> But it didnt work.

It should work, but in any case, the cookies will be maintained per thread.

> I am using jmeter 2.5 version. Can anybody help me with this?

As a separate issue, you should upgrade JMeter to the current version;
2.5 is quite old.

> Thanks !
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Persist JSESSIONID throughout a TestPlan

Posted by sebb <se...@gmail.com>.
On 27 March 2013 21:52, Deepak Shetty <sh...@gmail.com> wrote:
> a bit late but I wrote this up
> http://theworkaholic.blogspot.com/2013/03/sharing-session-ids-across-threads.html

Note that Java properties are also global.

But like any cross-thread sharing, you have to be aware that it might
impact performance if access requires locking.

>
> On Mon, Mar 11, 2013 at 4:48 AM, Alaka P A <al...@gmail.com> wrote:
>
>> I have to test the webserver which has to maintain sessions.
>> For this purpose I need to maintain session ids in jmeter.
>> It has been working for ThreadGroup as I
>> am using HTTP Cookie Manager for every Thread Group.
>> But i want to use the same
>> JSESSIONID across the test plan which includes several Thread Groups.
>> Not able to achieve this.
>> I tried using HTTP Cookie Manager globally for a Test Plan,
>> But it didnt work.
>> I am using jmeter 2.5 version. Can anybody help me with this?
>> Thanks !
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Persist JSESSIONID throughout a TestPlan

Posted by Deepak Shetty <sh...@gmail.com>.
a bit late but I wrote this up
http://theworkaholic.blogspot.com/2013/03/sharing-session-ids-across-threads.html


On Mon, Mar 11, 2013 at 4:48 AM, Alaka P A <al...@gmail.com> wrote:

> I have to test the webserver which has to maintain sessions.
> For this purpose I need to maintain session ids in jmeter.
> It has been working for ThreadGroup as I
> am using HTTP Cookie Manager for every Thread Group.
> But i want to use the same
> JSESSIONID across the test plan which includes several Thread Groups.
> Not able to achieve this.
> I tried using HTTP Cookie Manager globally for a Test Plan,
> But it didnt work.
> I am using jmeter 2.5 version. Can anybody help me with this?
> Thanks !
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Persist JSESSIONID throughout a TestPlan

Posted by Adrian Speteanu <as...@gmail.com>.
This question has been asked before, but I don't remember a time it has
been solved.

You'll want to create a variable in one of the thread group, such as
"variable_<number_of_thread>" and then all other threads will be able to
reference it. Of course, you'll need to make thread groups with an equal
number of threads. Creating the variable is easy, but making it accessible
to the other threads was not possible in older version (? maybe I'm
mistaken about this, but I looked to implement this particular use-case 3
years ago and found no solution). However, with the versions released in
the last couple of years, you have the beanshell server that can help with
this. I haven't tested it yet, its in my to do list, but I think someone
explained how it can be used to update a variable from within multiple
threads, the same principle should apply in your use case. Also, there is a
plugin:
http://code.google.com/p/jmeter-plugins/wiki/InterThreadCommunication, that
might do the job, but again, haven't had the time to use it myself.

So you're use-case is doable, but you should be double-careful :) and test
that what you think you are doing is actually what is happening. With
thread sharing and concurrency you can easily run into weird situations
(i'm thinking other values than expected, but memory leaks aren't excluded
either).

Good luck with this.

Also, please be kind and let us know what solution you used in the end. I
think you should appreciate how useful this contribution might be for
someone else.

Thanks,
--Adrian S

On Mon, Mar 11, 2013 at 1:48 PM, Alaka P A <al...@gmail.com> wrote:

> I have to test the webserver which has to maintain sessions.
> For this purpose I need to maintain session ids in jmeter.
> It has been working for ThreadGroup as I
> am using HTTP Cookie Manager for every Thread Group.
> But i want to use the same
> JSESSIONID across the test plan which includes several Thread Groups.
> Not able to achieve this.
> I tried using HTTP Cookie Manager globally for a Test Plan,
> But it didnt work.
> I am using jmeter 2.5 version. Can anybody help me with this?
> Thanks !
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>