Jmeter----badboy recording script

For most people who are new to performance testing, the code skills may not be very good. We can use tools and record scripts to test to achieve our goals.

Generally speaking, there are two ways to record a script

1. Use badboy for script recording

1. Download and install

Badboy official website address: http://www.badboy.com.au

Tip: There will be user email verification when downloading from the official website, just continue to skip and just download

Installation: It is the same as the normal Windows installation program, just do not mind the next step; after the installation is complete, there will usually be badboy shortcuts on the desktop and start menu. If not, find the badboy.exe file in the badboy installation directory and double-click to start Can

Startup: After starting badboy, the interface is as follows

Insert picture description here

2. Recording

1) As shown in the picture above, enter the URL of the web application you need to record in the address bar (red area), here is http://www.baidu.com as an example

2) Click the start recording button (circled above the address bar) to start recording

3) After starting recording, you can operate the tested application in the browser embedded in badboy (right side of the interface), and all the operations will be recorded in the editing window on the left side of the interface (yellow marked area)

The recorded script is not a line of code, but a web object, a bit similar to the tree view view in VuGen in loadrunner

4) After the recording is completed, click the stop button (green marked area) in the toolbar to complete the recording of the script

5) Click file→save or export to jmeter, save the file as jmeter's script format: .jmx; start jmeter, open the file just recorded and saved, you can test

2. Use jmeter proxy server for script recording

1. Start jmeter: add a thread group to the test plan, and add a logic controller → recording controller to the thread group

2. Workbench: add non-test components → http proxy server

3. Port (proxy server listening port): set to 8080 (generally speaking)

Target Controller: Test Plan-Thread Group

Group selection: each group puts a new controller

4. http proxy server: right click, add timer → Gaussian random timer (tell jmeter to automatically add a timer to the http request it generates)

The timer will delay the corresponding sampler: the next sample request affected by the timer will be sent only after the previous request to send is responded to and the delay is specified time

If a Gaussian random timer is used in the proxy server, it should be added to the fixed delay offset: ${T}: the delay time used to automatically reference the record

5. Open the browser, network settings, set the proxy server in the LAN settings to localhost and the port to 8080

6. After the proxy server is configured, click Start, and the proxy server will start recording the accepted http requests

7. Enter the address to be tested in the browser address bar and perform related operations. After the recording is completed, stop the http proxy server, right-click on the recording controller, and save the recorded script

Note: Don’t forget to restore the proxy server settings to the original

8. After the script is recorded, start jmeter, and you can start the test

Guess you like

Origin blog.csdn.net/weixin_47580822/article/details/110209882