This should ensure that they are executed sequentially :
So let's start with thread group.
Number of Threads(users) is 5.
So assuming you have the logic work out for your login sampler. Just add additional sampler to it. So right click on that sample Add > Post Processors > BSF PostProcessor
, inside this post processor big script space write ${__setProperty(ThreadValue,${__threadNum},)}
.
This will save the thread number to your property called ThreadValue
. Make sure you select your language as beanshell
in the dropdown list.
Then after the login sampler add the if controller. Add this to the condition field (${JMeterThread.last_sample_ok}==true) && (${__property(ThreadValue,,)} == ${__threadNum})
What this means is that -> do only logged in stuff while the actual login is successful and if the login thread matches the thread you're currently in.
That's it you do your login stuff only inside the if controller. If you want to be sure that you logout the right user place additional if controller arround it.
Cheers