Jmeter_ Upload and download

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.