Jmeter 5.1 achieve picture upload interface test

 background:

Course of the project needs to crawl interface interface test upload pictures, upload all very much the same, nothing more than the contents of the different parameters, it is recorded here, as do some other reference to upload

 

 

1, to grab by fiddler parameters are as follows:

Content-Disposition: form-data; name="file"; filename="9.gif"

Content-Type: image/gif

Figure:

2, jmeter The data capture configuring

Note here: name = "file", http request parameter Name is: name value; MIME TYPE is: Content-Type value

3, check the Use multipart / form-data (due to the acquired header information for the Content-Disposition: form-data; form-data need to check this file upload request will be included, otherwise it will error)

4, select java implementation

Analytic understanding:

Java: http JAVA JVM using the method used to provide, there are limitations associated with: 1) no control in how to reuse the connection request; 2) When jmeter released a request may not be reused in the same process up; 3) use only in single-process mode; 4) HTTPS proxy requests have two bug did not exist; 5) does not support virtual hosts; 6) associated methods are not supported; 7) does not support the request for the certificate is stored.

HttpClient4: using Apache HttpClient 4.1 member.

5, upload pictures successfully executed

6, thinking

In the windows parameter request file path is not found in the current directory preparation method, can be identified by the current directory ./ way server, the script needs to modify the path to the server.

If the windows have to know the current path of the welcome message.

 

Guess you like

Origin www.cnblogs.com/yoyoblogs/p/11320290.html