简体   繁体   中英

JMeter : How to handle asynchronous http post request

I'm trying to automate a POST call where I'm getting multiple responses every 5 seconds.

For example, while uploading a file,

file read......200 OK

Uploading Started.....200 OK

Uploaded......200 OK

And after certain time, when the process is complete on the server side, I get a response saying "Finished Successfully...200 OK".

But in JMeter, connection is closed when first 200 is received. How can I wait for all the responses conditionally and exit when the desired response is received by the request?

You will have to use Java Request and develop a custom org.apache.jmeter.protocol.java.sampler.JavaSamplerClient class.

You can use http://hc.apache.org/httpcomponents-client-ga/ for the HTTP Client library, but ensure you use the same as JMeter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM