[Jmeter]jmeter script recording and playback, optimization (Jmeter under Windows) One, recording script:
1. Start JMeter
2. Add Thread Group
3. Add HTTP Proxy
4, configure the agent
A, JMeter side (note: Lest plan content Here you need to select the target controller, this is the controller that needs to be selected in the test plan, this example needs to select "Test Plan > Thread Group")
b, IE end
Control Panel \ All Control Panel items \ Network and Sharing Center Internet Options Connection LAN settings
C, start the Script recording program (click on the JMeter HTTP proxy interface of the Start button)
D. Access the interface that needs to be tested, such as www.baidu.com
E. Stop the Script recording program (click the Stop button in the JMeter HTTP proxy interface of a)
F. View Recording Script
Second, playback script:
1. Add listener to view script run results
2, select the thread group click to execute
3. View Run Results tree
4. View aggregated reports
Third, optimize the script:
1, delete unnecessary content, such as *.png (can be excluded in 4.a)
2. Set the number of times to run test cases concurrently
Means: Running 100 threads, 10 seconds running complete, that is, averaging 0.01 seconds running 1, looping 10 times
3, set the delay device, let the test results more specific and clear
Number of simulated Users to Groupby: How many threads are freed each time. If set to 0, the equivalent is set to the number of threads in the thread rental.
A setting of 10 means that 10 threads are at the same time, combining the previous step, representing every 0.1 seconds, and 10 concurrent
4. Click Execute to see the results
5. If you need to keep cookies, you can choose to add an HTTP cookie Manager
Note: The method of obtaining cookies is simple, this article has chrome as an example:
On the page of the cookie you want to view. Click directly on the document book in front of the address bar: All cookies maintained by Chrome will appear.
6, can also add assertions, the test results to judge, this article is an example, just to return the corresponding text for a simple judgment
[Jmeter]jmeter script recording and playback, optimization (Jmeter under Windows)