Sending bulk data to post to API for volume testing

Hi,

I’m trying to test 1000 records hitting the API I developed, but it’s not reading anything from the CSV file I made with the data. I don’t have any pre-request script logic happening. If there’s something I need to have where it goes and finds the first line of data and then loops back through the consecutive other pieces of data, then I would like to know.

Thanks!

@jamesst9 Could you share some insights on the following:

  • What is the structure of the CSV file?
  • How exactly does your request look like?
  • Are you using the CSV file as a datafile in collection runner?
  • Are you familiar with the concept of data files usage inside collection runner?
  1. It has the property names on the first line followed by the values beneath it. This is for receiving health insurance leads

  2. To start, the api receives data, whether it’s in xml or json format and deserializes them into the respective properties.

         var resolveRequest = HttpContext.Request;
         resolveRequest.InputStream.Seek(0, SeekOrigin.Begin);
         string apiCall = new StreamReader(resolveRequest.InputStream).ReadToEnd();
    

That’s how it gets it.

  1. Yes I’m trying to use it as the data file, but it is returning nothing at all.
  2. Yes I’ve mulled over this page for hours. When I try to import as a collection file, it returns an error. My preview data looks similar to the example in collection runner. I feel as though I need something in the pre-request script, but I’m not sure what.

Can you share with me the request where you’re using the data variables?
A screenshot would help.

Are you using it in the request body/query param/headers?

For eg. this is how you can use it in the query params:
image

I’m getting it from the request body. My url looks like this: http://localhost:63993/Post/Post

I’ve tried converting the data to json and putting it into the body of the postman call, but my code only handles one entry at a timen. I would assume that you wouldn’t need it though if you import a file for the collection runner.

I figured it out. I needed to have a json example in the body and have the endpoints in brackets for them to point to it.

{
"phone": "{{phone}}",
"address1": "{{address1}}",
"address2": "{{address2}}",
"city": "{{city}}",
"State": "{{state}}",
"firstname": "{{firstname}}",
"lastname":"{{lastname}}",
"vendorname": "{{vendorname}}",
"password": "{{password}}",
"vendorid": "{{vendorid}}",
"leadcost": "{{leadcost}}",
"campaignid" : "{{campaignid}}",
"sourceipaddress" : "{{sourceipaddress}}",
"sourceurl" : "{{sourceurl}}",
"email" : "{{email}}",
"county" : "{{county}}",
"zip" : "{{zip}}",
"contacttime" : "{{contacttime}}",
"clientipaddress" : "{{clientipaddress}}",
"clientsessionid" : "{{clientsessionid}}",
"clientbrowser" : "{{clientbrowser}}",
"externalleadid" : "{{externalleadid}}",
"callconsent" : "{{callconsent}}",
"smsconsent" :"{{smsconsent}}",
"text" : "{{text}}",
"url" : "{{url}}",
"coveragetype" : "{{coveragetype}}",
"currentcompany" : "{{currentcompany}}",
"currentlyinsured": "{{currentlyinsured}}",
"qualifyinglifeevent" : "{{qualifyinglifeevent}}",
"qualifyinglifeeventdate" : "{{qualifyinglifeeventdate}}",
"deniedcoverage" : "{{deniedcoverage}}",
"lostcoverage" : "{{lostcoverage}}",
"pregnant" : "{{pregnant}}",
"treated" : "{{treated}}",
"hospitalized" : "{{hospitalized}}",
"prescriptionmedications" : "{{prescriptionmedications}}",
"majorconditions" : "{{majorconditions}}",
"householdincome" : "{{householdincome}}",
"selfemployed" : "{{selfemployed}}",
"notes" : "{{notes}}",
"gender" : "{{gender}}",
"birthdate" :"{{birthdate}}",
"height" : "{{height}}",
"weight" : "{{weight}}",
"tobacco" : "{{tobacco}}",
"campaignname" : "{{campaignname}}",
"dialerstrategy" : "{{dialerstrategy}}",
"dialerpriority" : "{{dialerpriority}}",

}

1 Like

Yes, that’s how you use variables in the request body.
Great!