using the same user for all iterations

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

using the same user for all iterations

Alexander Podelko
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
 
ZK
Reply | Threaded
Open this post in threaded view
|

Re: using the same user for all iterations

ZK
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: using the same user for all iterations

glinius@live.com
In reply to this post by Alexander Podelko
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: [hidden email]
For additional commands, e-mail: [hidden email]