JMeter: Generate unique csv file then POST - testing

Completely new to JMeter.
Just wondering if it can be configured to generate a file (i.e. .csv) and then post said file with a HTTP POST?
I've searched a bit on the internet but can't work out whether it is possible...
Reason I want to do this is that I want to test a server that receives data in the form of a .csv file and uploads it to a database. Hoping to test this server by sending a whole bunch of randomised data.
Would be good to have different threads sending different amounts of data at different rates.
Any tips would be amazing, I am a complete newbie.
Cheers

It is possible to upload a file using JMeter HTTP Request sampler.
JMeter supports beanshell which is Java - scripting language. It can be used to create a CSV file& store it in some path.
Update the csv file path in the 'Send file with the request' of the HTTP Request sampler.

Related

JMeter : Large File Upload in chunks

We are trying to test large file upload scenario in JMeter.
When we upload a file with size of 15MB, it will break into 3 chunks (each chunk has 5MB).
I could see separate request in developer tools for each and every chunk going to the server with chunked data. I hope this chunking mechanism is something handled at the client side but not in server.
It would be a great help if anyone helps to achieve the same in JMeter.
Thanks in Advance..
You can mimic this behaviour using HTTP Raw Request sampler
Install HTTP Raw Request sampler using JMeter Plugins Manager
Capture the real request from the browser using a sniffer tool like Wireshark
Copy and paste raw TCP stream into "Request data" input field
That's it, now you should be able to replay the request using JMeter exactly as it is. You might need to perform parameterisation/correlation
Check out The JMeter HTTP Raw Request Sampler - When and How to Use It article for more detailed information if needed.

Jmeter csv config for file upload

I'm using Jmeter for testing file uploads. This works great when I upload just one file, but I want to be able to loop through a list of files. I see Jmeter has a CSV based config capability, but I can't figure out how to include a file as one of the params.
How can I specify a list of different files for jmeter to loop through, uploading one per request?
You need to pass:
either relative or full path to the file being uploaded
upload input name
file MIME type
So if your CSV file will look like:
c:/testfiles/test.txt,upload,text/plain
c:/testfiles/test.jpg,upload,image/jpeg
etc.
And CSV Data Set Config is configured as:
Your HTTP Request Sampler configuration should look somehow like
References:
CSV Data Set Config
Performance Testing: Upload and Download Scenarios with Apache JMeter

Export file from NetSuite's FileCabinet to FTP

File resides in the NetSuite file cabinet and needs to be placed on an FTP server each day.
I'm not sure how to handle this via Suitelet/RESTlet, or if it's possible - but would prefer to not use an external source/application.
My current and hopefully temporary workaround is a local scheduled task to run a script to pull files from NetSuite & upload to the FTP.
In SuiteScript 2.0, although unsecured FTP is still not support, but SS2.0 has the capability to do SFTP. See http://www.upilioconsulting.com/blog/netsuite-2016-2-sftp-suitescript-2-0/
In SuiteScript 1.0, it's not supported. The workaround is that you'll need to write a middleware code (i.e. in PHP) and let the middleware do the FTP transfer.
Netsuite doesn't interact with FTP.
You need a bridge server of some sort that runs a web app (full blown Apache or nginx running PHP or just a simple Node service)
Just get a server and install some web server/web service and POST your files to it (nlapiRequestURL with a Scheduled script). Have the web app on the bridge server send the files to the FTP server. If you are using Netsuite you can afford the cost of the bridge server.
One possible solution is to create a saved search on the Documents to list out all the files in Netsuite filtering by createdate or lastmodifieddate. Create a scheduler to fetch only the new files and save them locally where you want.
Note all the files will be in base64 encoded string format, you need to decode again to obtain the file.
As bknights said NetSuite doesn't support FTP. You need a web server(any server side language can do for that matter, I have written one in Node.js), to receive the files.
The file content for text file will be in Text format, so, no decode logic required for text files. However, binary/pdf/image and other would be in base64 format, as NetSuite's JS has no way of handling binary data. So, make sure you decode it before you create the file on your FTP Server.

Does apache commons fileupload support chunked uploads?

We have moved to using PLupload for file uploads and found that it can support "chunked" file uploads. The problem is that our server sees one large file upload as multiple smaller files coming in multiple POST requests.
Does anybody know if Apache Commons FileUpload supports chunked uploads?
FWIW looking at the PLupload webpage the "Chunking" they are talking about is not "HTTP Chunking". http://www.plupload.com/index.php
Their marketing term "Chunking" is their concept of sending a large payload up in small and separate HTTP requests. The server is required to have logic to group, stitch up and verify all the small parts. You are better off getting help on their forum on this. There is no reason why this logic can not be created by you on the server side and maybe they have example Java code implementing it.
Useful info and pointer to their upload.php example (maybe you convert to Java and on top of Apache Commons FileUpload) :
http://www.plupload.com/punbb/viewtopic.php?id=1484
What you are observing the small segments of a file arriving like they are separate files is exactly how the "PLupload Chunking" mechanism works. This technique is not defined in any standard, but it is also not an uncommon solution to the problems it addresses.
The "HTTP Chunking" is standard for defining how to transfer a single HTTP Request (and/or HTTP Response) between click/server using a HTTP transfer encoding. This is supported by all webservers and all browsers and has been around for a long time (since HTTP/1.1).

How do I get a status report of all files currently being uploaded via a HTTP form on an Apache Server?

How do I get a status report of all files currently being uploaded via HTTP form based file upload on an Apache Server?
I don't believe you can do this with Apache itself. The upload looks like nothing more than a POST as far as Apache cares. There are modules and other servers that do special processing to uploads so you may have some luck there. It would probably be easier to keep track of it in your application.
Check out SWFUpload, its uses Flash (in a nice way) to assist with managing multiple uploads.
There are events you can monitor for how many files of a set have been uploaded.