I am currently trying to edit a jmeter test (for eCommerce) so i would have 10% of X number of users have a specific number of 5 products in the cart ( nothing more, nothing less).

If using a While Controller, how and what should i add?

I have created a CSV file with around 20 items so it can loop through the items i have selected.

The problem is that currently the cart counting starts from 1 and stops at 5, and the checkout is not made. Before adding the While Controller, the checkout was correctly made.

Where and what should i change?

I have compared 2 tests : on the first one, the checkout is correctly made. Items are randomly added, starting with one, finishing with a random number. The checkout is made using an If controller and a throughput controller.

On the second test, having the same set up for the checkout, i have added a condition ${cartitems} == 5 before the checkout( the var is declared before). The items are still randomly added, starting with 1.

1 Answer 1


No one will be able to help unless you share more details, few hints:

  • Inspect jmeter.log file, in case of While Controller malfunction (i.e. bad condition) JMeter should write something there
  • Add View Results Tree listener and compare request and response details for 2 scenarios:

    1. Without While Controller
    2. With While Controller

See How to Debug your Apache JMeter Script article for some hints on JMeter tests troubleshooting

  • I have tried with both While controller and Loop Controller. While seemed to be a bit better for this, but i don't really know how to configure it. The difference was that one test stops before checkout, the other one proceeds to checkout. I can't figure out what condition i should add to have a specific number of products in all carts and also proceed to checkout with only 3% of the users, not all.
    – Ruxandra
    Commented Feb 8, 2017 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.