Jmeter Web platform interface test script 2-file upload function test

step:

  1. Open the Fiddler packet capture tool
  2. Upload files in the platform to be tested
  3. Find the upload-related data in the package captured by fiddler, and observe the request data
  4. Create a new HTTP request in jmeter for file upload, click Run to view the return value

Remarks:

  1. The above is performed when the platform has been logged in (for login details, see Jmeter Web platform interface test script 1) Jmeter Web platform interface test script 1
  2. The path of the file to be uploaded is best to be typed by yourself. Right-click to copy and paste the path in the properties, and it will report Java-File not found exception.

Fiddler captures packet data:

Insert picture description here

Create an HTTP request and configure parameters in jmeter:

Insert picture description hereInsert picture description here

Insert picture description here
Operation result:
Insert picture description here
Check whether the upload is really successful in the platform system:

Insert picture description here
Note: In Jmeter, I built a Beanshell post-processing file

Insert picture description here
This file (paste the code in the script: prev.setDataEncoding("UTF-8")), the purpose is to allow the Chinese in the returned body to be displayed normally. After uploading the file name, the garbled code shown here is Baidu. It is a vulnerability of Jmeter5.3 version, which needs to be repaired by another file. Here I don't want to make progress. If you think it is necessary to fix it, you can search it on Baidu by yourself.

Guess you like

Origin blog.csdn.net/KathyLJQ/article/details/110480725