2
votes

I am using JMeter for load Testing my Application .

As part of payload i am sending 3 parameters to the REST Webservice call

ordersplitjson  = {"highPriceVendor": "VC4 Raj","vendors": {"T1": [{"item_ids_": "194","leaf": [{"orderid": "14101519","cust_id": "22"}],"vendor_id": "9"}]}}
customer_id  =  22
homedelivery  = Yes

I am loadtesting the Application with 100 users with a Ramp Time for 2 seconds .

This is the way i have configured and this works fine for static payload

enter image description here

As part of load Test , i want to login as different user for every request (Means for every request i want to send different parameters )

I guess i cant use CSV DataSet Config as i have a JSON as a payload

could anybody please let me know how to achive this load test with different payloads

1

1 Answers

2
votes

You should still be able to use CSV Data Set Config by following one of below approaches

  • Option 1: change "Delimiter" from default comma `,' to something else which won't be in your JSON payload, i.e. | , put your JSON payloads into CSV file and use them as it.

  • Option 2: You don't necessarily need to have the full JSON in the CSV Data Set element, it can be configured to read multiple values into multiple variables, i.e. your CSV file will be something like

    VC4 Raj, T1, 194, 141519, 22, 9
    

And Variable Names in CSV Data Set Config will be

highPriceVendor, vendors, item_ids_, orderid, cust_id, vendor_id

In that case you can configure your request body as:

{"highPriceVendor": "${highPriceVendor}","vendors": {"${vendors}": [{"item_ids_": "${item_ids_}","leaf": [{"orderid": "${orderid}","cust_id": "${cust_id}"}],"vendor_id": "${vendor_id}"}]}}

See Using CSV DATA SET CONFIG guide for instructions on the second approach.