Use jmeter for stress testing (2)

Source: Internet
Author: User

Jmeter does not have a lot of Chinese materials. I Googled it and found that I basically didn't describe how to use it step by step. I will sort it out first.

There are the following aspects:

    1. Recording script
    2. Use custom Parameters
    3. Use Controller
    4. Use Timer
    5. Use a front-end Processor
    6. Use listeners

I am only at the entry level, so the writing may be relatively simple and suitable for beginners.

This article describes how to use the HTTP Proxy Server to record scripts.

Jmeter can be used for recording scripts or other tools, such as Badboy recording scripts suitable for jmeter. By default, jmeter features are used.

Open jmeter, right-click the workbench node, and choose add> non-test component> HTTP Proxy Server. Use the default settings.

Set the browser and set the proxy server to 127.0.0.1: 8080.

 

 

Start the HTTP Proxy Server. Take Google as an example. The generated script is as follows:

It records many JS, CSS, PNG, and GIF paths, which are useless for testing scripts. We can set the exclusion mode on the HTTP proxy server, do not record these.

After setting the exclusion mode, restart the HTTP Proxy Server and open the Google homepage again. The recorded script is much more concise.

Take the search for "jmeter" as an example. The recorded script is as follows:

In some webpages that use JavaScript many times, JS actions will also be recorded. For example,/complete/search is the JS action in the input prompt box and can be deleted.

Jmeter script recording is like this, in addition to other tools, such as Badboy, it is easier to use, specific can refer to the official website http://www.badboy.com.au /.

Finally, when setting the HTTP proxy server, you need to note the following two points:

    1. Check whether port 8080 conflict with each other.ProgramFor example, the web server is occupied. If there is a conflict, you can change it to another port without conflict.
    2. The jmeter HTTP Proxy server port must be consistent with the port set by the browser

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.