Tester77
Tester77

Reputation: 319

Jmeter: Is it possible to increment the value of variable for every thread in Jmeter?

Example: Thread: 50, Ramp-Period: 0, Loop: 1.

I have to send different value with each thread. Is it possible to do it without changing the loop count?.

Upvotes: 2

Views: 4891

Answers (3)

irham iqbal
irham iqbal

Reputation: 41

You can achieve this by adding a counter under the thread group. In the counter it's possible to set the start, increase and maximum number you want to reach. Then add reference name in counter, which will be used in your request as ${reference_name}

Upvotes: 0

vins
vins

Reputation: 15370

Your question looks like this - jmeter unique id per thread for http request

You can also use Beanshell to create an unique ID for every thread.

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168072

  1. If you need to add something to an existing variable it may be done via __intSum() function
  2. __counter() function generates incremented number each time it's being called either per-thread or global
  3. Another candidate is __threadNum() function which is basically the number of current thread.

See How to Use JMeter Functions posts series for advanced information on above and other useful functions.

Upvotes: 1

Related Questions