2

I am new to JMeter, so please bare with me. Let's say I have a performance test with 100 v-users and I want to have at least 20 items in the cart / user. How can i control this in JMeter and where?

1

You have at least 3 options, depending on what exactly you're trying to achieve:

  1. Thread Group - Loop Count - defines the number of iterations for each virtual user (affects all nested samplers)
  2. Loop Controller - basically the same as above, but you can limit iterations to only those samplers which are required
  3. Throughput Controller - controls how many times (in absolute number values or percentages) children samplers are executed. See Running JMeter Samplers with Defined Percentage Probability article for more detailed explanation of the Throughput Controller and the Switch Controller
0

To check 100 users login and each user need to have 20 items in their cart, you need to create a flow with Data Driven execution. Preferable way is to create a excel/csv file and save all the 100 username and password in it.

  1. Create HTTP request for Login API:- Fetch the first username & password and perform login.
  2. Create HTTP request for Cart API: In the body, include all 20 items you want to have in that user`s Cart(If you dont want each user to have same items in Cart then create another excel/csv file containing several cart Items)

Put HTTP1 and HTTP2 in a for loop where condition will be end of the line or 100(whichever suites you)

1
  • I am trying to edit an already created test that functions properly - i tried to change the maximum cart items, but with no results. The search items are randomly generated - taken from a csv. Where can i edit to make the v-user add more than 1 item each in the cart? – Ruxandra Dec 23 '16 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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