jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darius Damalakas <darius.damala...@gmail.com>
Subject Re: Issue concurrent requests for a logged in user
Date Tue, 31 Dec 2013 10:03:34 GMT
Ok, thanks for the input.  Will try going with the properties route then.

http://jmeter.apache.org/usermanual/functions.html#__setProperty seems will
do the trick :)


On 30 December 2013 00:48, sebb <sebbaz@gmail.com> wrote:

> On 28 December 2013 14:32, Darius Damalakas <darius.damalakas@gmail.com>
> wrote:
> > Hi,
> >
> > I have trouble figuring out how I should set up my test plan so that I
> > could test how my server responds to concurrent requests by same user.
> > These will be AJAX requests, but for simplicity lets just take that
> > multiple HTTP Get will be used.
>
> The only concurrent requests that JMeter currently supports is for
> downloading embedded page resources.
>
> > I have tried several options, but none of them so far seem to accomplish
> > this.  Note that we do have a policy that a user can have only a single
> > session. So, if a user tries to login again, the previous sessions get
> > discarded, and a new session token issued and sent back as a cookie.
> >
> > So far i've tried several options.
> >
> >
> > 1.  This will generate sequential requests, not concurrent
> >
> > Cookie manager as global
> > -- Thread group (1 thread, loop count 5)
> > ---- Once Only Controller
> > ------ Load Login page
> > ------ Extract CSRF token
> > ---- Post username/passw/csrf token
> > ---- Sample HTTP Get
> >
> > 2.  Same test plan as above, just add more threads.
> > That dosn't work because a single user can have just 1 active session. So
> > the last thread wins and invalidates all the other threads.
> >
> > 3. Have a setup ThreadGroup.
> >
> > CookieManager
> > --SetUp ThreadGroup
> > ----Login, save cookie, etc
> > --Main thread group (5 threads)
> > ---- Sample HTTP GET
> >
> > This would work, but individual threads have separate cookie storages. So
> > this means that main thread will fail with unauthorised requests, since
> > auth cookie will not be transfered from setup thread.
> >
> > I was thinking of having 2 cookie managers, one in set up thread, the
> other
> > in main thread. If it's possible to cop over auth cookie from one cookie
> > manager to the other, this plan would work.
> >
> > Tried to make this work by setting 'CookieManager.save.cookies=true', but
> > inspecting variables with Debug Sampler looks like variables are not
> shared
> > between thread groups.
>
> JMeter is designed to emulate multiple users.
> Each JMeter thread therefore has its own variables and cookies etc.
> They are deliberately not shared.
>
> > Any alternatives?
>
> Although variables are not shared, properties are shared.
> They are not really suitable for values that change frequently, but
> they can work OK if a setup thread sets the property and all other
> threads read the
> property.
>
> You might be able to use a setup threadgroup to login and extract the
> cookie, saving it in a property.
>
> Then use a normal thread group to issue the requests.
> Obviously you will need to skip the login phase.
>
> > Darius,
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Darius
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>


-- 
Darius

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message