You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Alexander Podelko <ap...@yahoo.com.INVALID> on 2018/06/20 19:36:29 UTC

using the same user for all iterations

Hi,

I have a thread group doing multiple iterations of login - do something - logout. I want to use a unique user for each thread - but the same one for each iteration. So thread 1 use the same user0001 for all iterations.

I have a CSV Data Set Config with user names, but it appears that "All threads" sharing mode takes a new record each iteration of each thread. It doesn't appear that any other sharing mode works the way I want. 

Any idea how can I do that?

Thanks,
Alex
 

Re: using the same user for all iterations

Posted by "glinius@live.com" <gl...@live.com>.
You can do this using one of  JSR223 Test Elements
<http://jmeter.apache.org/usermanual/best-practices.html#jsr223>   or 
__groovy() function
<https://jmeter.apache.org/usermanual/functions.html#__groovy>  , the
relevant code would be something like:


> new File('test.csv').readLines().get(ctx.getThreadNum())

where *ctx* stands for  JMeterContext
<https://jmeter.apache.org/api/org/apache/jmeter/threads/JMeterContext.html>  
class instance. 

More information on Groovy scripting in JMeter:  Apache Groovy - Why and How
You Should Use It <https://www.blazemeter.com/blog/groovy-new-black>  



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

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


Re: using the same user for all iterations

Posted by ZK <st...@gmail.com>.
hi,

you could set the user name like this when you login:

user000${__threadNum}



ZK



--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

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