Unanswered question

How to Parameterize the ''Source file' to take Multiple File's for each iteration

Context - We are supposed to upload multiple files to FUS (File Upload Server), apparently we are able to provide the full path of the file in 'Source File' under 'Multipart/Form-Data' and upload a single file and we are unsure on how to pass multiple files in Source File (attached snapshot) .

Chandra S.
Chandra S.

Chandra S.

Level
0
28 / 100
points

Answers

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

I'm not sure to understand. You would like to upload multiple files at the same time with that POST request?

Or do you want to upload a different file on each user iteration?

For the latter you can simply replace the static path of your source file field by a NeoLoad variable.

That variable will contain the different file names and  have a change policy of "on each iteration". Then under your project folder create sub folder named "resources" and put all your files inside that folder.

In your POST request make sure to add resources\<yourfilename> as path.

 

Musaffir L.
Musaffir L.

Musaffir L.

Level
1
215 / 750
points

Hello Nouredine,

Sorry for posting a reply to an old post here...
Would like to share something that I experienced related to this post...

I tried parameterizing upload file name using the neo load variable concept .
I have my upload files in a "Test Data" folder which is from the base path of the project .
My objective is to choose diff files for uploads in each iteration.

if I pass the file name as - "Test Data\${fileNameVariable}"
neo load is not passing it as a file type.
My file is of excel type
NeoLoad do not pass it as excel hence, so the upload action at my application always fails.

But if I pass the file name as the absolute complete path as - "C:\NeoLoad_New_Projects\My Project\Test Data\${fileNameVariable}"
it is picking up as expected.

Are you aware of any such behaviour.
I am expecting my first case to workk
Using neo load 5.2.4 version...

Thanks
Musaffir

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

Hello Musaffir,

This is expected when you use an absolute path then NeoLoad will look at that path to find your files. But using absolute path means that if you use remote Load Generators that path should exist on all of them otherwise it will not work. It's an issue if you have different OS for load generators.

To remove that limitation the best is to use a relative path like explained in that post but instead copy all your files under the "custom-resources" folder since you are using NeoLoad 5.2.xx version (the procedure in that post was for an older NeoLoad version).

Then in your POST request you can use that relative path ${NL-CustomResources}/${fileNameVariable}

NeoLoad will automatically translate that variable ${NL-CustomResources} to an absolute path on each load generator whatever the Operating System. It's the best solution that will work all the time.

 

Musaffir L.
Musaffir L.

Musaffir L.

Level
1
215 / 750
points

Thanks Nouredine

Should I keep my data exactly after the cutom resource folder
like
${NL-CustomResources}/${fileNameVariable}

Can't I create sub folders after ${NL-CustomResources}
say
${NL-CustomResources}/Test Data Folder/${fileNameVariable}

The latter seems not working for me... it isn't passing able to pick the file and do upload....though i see correct path etc..

Thanks,

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

You need to copy all your files inside the "custom-resources"  without any subfolders otherwise it won't work.

Musaffir L.
Musaffir L.

Musaffir L.

Level
1
215 / 750
points

Thanks Nouredine for confirming it .
I think it would be good if we can have an improvement on this in the future release.

If I have a huge list of such data for different requests path, then the ability to categorize them in sub folders with in custom resource would be a good thing I believe

Warm Regards
Musaffr