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:
- Recording script
- Use custom Parameters
- Use Controller
- Use Timer
- Use a front-end Processor
- 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:
- 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.
- The jmeter HTTP Proxy server port must be consistent with the port set by the browser