JMeter Counter not Incrementing when checked using vars.get()

testPanda1089 :

I'm trying to use the 'Counter' element in JMeter to keep track of which thread is being run, but it doesn't seem to work. The Counter stays at '1' for every thread; I'm not sure if this is because the counter isn't getting incremented, or if the way I'm accessing the variable is incorrect.

This is the Counter Config.

This is the print statement I'm using. The code is:

System.out.println("In Preprocessor" + vars.get("userCount"));

This is the way my JMeter Project is structured

There are several SO questions with a similar title, and none of them have been able to help me out. This one, in particular, stated that the solution lied in using vars.get() which I'm using

Any help is appreciated!

(I have low SO reputation, so can't embed images directly)

testPanda1089 :

I had "Same User on Each Iteration" checked in Thread Group Config, and "Track counter independently for each user" checked in Counter Config. All I had to was uncheck the latter checkbox.

Moral of the story: Don't be like me, kids. Read the documentation.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=19540&siteId=1