Today, let's focus on jmeter upload and download
1:jmeter Uploading Files
First confirm your file name, parameter name, MIME type, these can be obtained from the interface document, or directly on the page to grab the package and then from the request header to view. Note that my file path here is a relative path, which corresponds to my bin directory
Second,choose Java Type in advanced, remember
Go and see the tree after you run it, there's not much to say.
2:jmeter downloading files to a local
First determine your download file interface to ensure that the interface responds correctly
It is emphasized here that the JMeter itself does not support saving files locally, and it is necessary to write a bit of java.
We add a BeanShell sample, written to Java
Import java.io.*;
Byte[] result = Prev.getresponsedata ();
String file_name = "D:\\gongju\\apache-jmeter-3.2\\bin\\download\\sqlent_${id}.zip";
File File = new file (file_name);
FileOutputStream out = new FileOutputStream (file);
Out.write (result);
Out.close ();
Pay attention to the order, don't be wrong oh ~
After executing the interface, go to the newly configured path and see that the file has been downloaded to the local
Here's a question, after my script runs, just click on the Customer Export button, the memory will soar, and there is no one to tell me why?
Jmeter_ Upload and download