Environment: win10
jmeter Version: 5.1.1
Test Site (sample): http: //www.baidu.com
Description: Reference web search results, the results for each write request local
1. Add a http request:
2. Add a post processing BeanShell
code show as below:
Import the java.io. * ; // this is a request to return the acquired data, prev obtaining request is returned byte [] Result = prev.getResponseData (); // location and file name of a file stored representatives; containing variable use path "/", excluding the use of the variable "\\"; _counter () function counters, each execution + 1'd String file_name = "E: / Test / threadNum the Thread $ {} _ __ __ $ {counter (FALSE,)}. ZIP " ; File File = new new File (file_name); a FileOutputStream OUT = new new a FileOutputStream (File); out.write (Result); the out.close ();
3. Add a tree view results
4. Run the program data to a local folder view, as follows