I want to set up a stress test for paying by One Pay in JMeter. But one payment just pays for one order; my test can't pay for the same order many times.

I think a possible solution would be:

  1. run 10000 API create order and set 10000 order IDs in a file.
  2. run 10000 API pay by One Pay with data in that file.

How would I set up such a solution in JMeter?

3 Answers 3

  1. First define your test scenario for 1 user

  2. Record script for this scenario (1 user)

  3. Now perform correlation analysis of all the requests to identify the dynamic parameters

  4. Use Regular expression extractor & JMeter functions to handle those dynamic parameters

  5. Run the script with 1 user and see if it works

  6. If it works successfully then you can move on to running the same scenario with more users

  7. Parameterize all the relevant parameters (For example there is any user ID involved for which you were using a static value earlier. now you will need to parameterize it using JMeter functions or CSV data set)

  8. Define no. of threads (users) in thread group and generate required load and run the test

Imp: Always run load tests in command line mode. Learn to use listeners tactically in your JMeter scripts.


You can omit the "file" step, like:

  1. Use HTTP Request sampler to create order
  2. Use Regular Expression Extractor to extract order ID into a JMeter Variable
  3. Use JMeter Variable from step 2 in "Pay" request.
  • Thanks you for answer, but i wanna run create order and pay by one pay separate. Because if run 2 api in same time that will make its performance wrong.
    – The Sun
    Feb 23, 2016 at 8:20

Yes you are right, you can put the parameters in a file! Use the CSV Data Set Config element and put the variables comma separated. Now declare the variable names in the CSV Data Set Config element and use them in your HTTP Requests. You need to prepare data in a CSV file that you want to use.

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.