I need to create a POST request and have to pass excel file in its body as a parameter, which needs to be changed with every iteration , please suggest?
You can look at this post here where it is explained how to use a POST request with an external source file.
Basically you need to copy your excel file in the custom-resources folder and in your POST binary request in the Source File field ${NL-CustomResources}\${Myfiles.file}.xls.
Your NeoLoad variable Myfiles will contain a file column where you have the list of file names without the xls extension.
Thanks Nouredine for your response. Please find snapshot for setting that I have done to create request. However , I am getting error as '{"error":"Invalid File type. Please provide a csv file."},. Please suggest if any thing is incorrect here..
Hello Anshika K.
The error message is saying that your variable type is not a csv.
Indeed, you are using List type variable instead of file Type variable.
Put the list of your files in a csv file and create file type variable on Neoload.
Best Regards,
Fousseyni B.
List variable type should be fine as it a list of filenames, could it be you are missing the full filename (see screenshot)
I tried passing it as file type variable and also trioed adding .csv at the end of file name still same error
Could the issue be with the "Content-Type" field that is empty in your request?
Maybe the server expects a specific content type here but you did not put anything.
You could try "application/vnd.ms-excel" or "text/csv".