[Jmeter]jmeter script recording and playback, optimization (Jmeter under Windows)

Source: Internet
Author: User
Tags http cookie

First, the 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

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.