Home >Backend Development >PHP Tutorial >JMeter learning (2) recording script
Environment
Badboy version 2.1.1
JDK: 1.7.0_67
Apache JMeter-2.11
-------------------------------- -------------------------------------------------- ----------------------------------
There are many ways to record scripts in JMeter, among which The most common method is to use the third-party tool badboy to record, and there is also JMeter's own settings (Http proxy server + IE browser settings) to record scripts. However, the scripts recorded by this method are more numerous and messy, and I personally don't like it. , Badboy is generally used for recording. Let’s introduce Badbody recording.
Note: When using JMeter proxy or BadBoy for recording, especially when using JMeter proxy, the operation should not be too fast, otherwise the recording may fail.
badboy introduction:
1. Open the badboy tool and enter the address of the tested project in the address bar
Note: badboy is in the recording state in normal state and is red button, as shown in the picture
After the recording is completed, click the black button next to the toolbar to end the recording.
2. Select "File"--Export to Jmeter...
3.OpenJMeter tool , select "File" --> "Open" to select the file you just saved (.jmx type) and import the file.
The recorded script must add HTTP Cookie Manager, otherwise the script will fail to run, remember.
Now for JMeter, a test plan can only have one Cookie Manager . Because when multiple Managers exist, JMeter currently has no way to specify which Manager to use. At the same time, cookies stored in a Cookie Manager cannot be referenced by other Cookie Managers, so it is not recommended to use multiple Cookies in the same test plan. Manager.
Adding cookies will ensure that each user uses a different cookie, but sharing an Http element, almost all web tests require cookie support.
The above introduces the JMeter learning (2) recording script, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.