Home >Backend Development >PHP Tutorial >JMeter learning (2) recording script, jmeter learning recording script_PHP tutorial
Environment
Badboy version 2.1.1
JDK: 1.7.0_67
Apache JMeter-2.11
----------------------------------------- -------------------------------------------------- ----------
There are many ways to record scripts in JMeter. The most common method is to use the third-party tool badboy to record. There are also JMeter's own settings (Http proxy server IE browser settings) to record scripts, but this method There are many and messy recorded scripts, which I personally don’t like. Generally, Badboy is used for recording. Here’s an introduction to 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.
Introduction to badboy:
1. Open the badboy tool and enter the address of the tested project in the address column
Note: badboy is in the recording state in normal state, which is a 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.Open the JMeter tool, select "File" --> "Open" select the file you just saved (.jmx type) and import the file. .
Be sure to add HTTP Cookie Manager to the recorded script, 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.