Jmeter (32) - From entry to proficiency - Jmeter Http protocol recording script tool - Badboy5 (detailed tutorial)

1 Introduction

  This article mainly wants to explain that recording the script is not the end. Sometimes we need to make assertions to see if the results are consistent with our expected results. This is all important in testing. To use an old saying: only look at the results and not the process.

2. Record the script

  If we want to assert, we must have a script to assert. Without a script, we cannot assert, so we still need to record the script here. One more nonsense: Jmeter recording scripts mostly use the Badboy tool, and its built-in recording is rarely used. Although badboy is no longer maintained, badboy is still highly recommended.

2.1 Recording scene

  Briefly describe the recording scene: Open the browser and enter the Sogou URL, visit Sogou, enter "Beijing-Hongge" in the search input box, and click the "Sogou Search" button.

2.2 Specific steps

1. Record the scene first: start recording, open the browser www.sogou.com, as shown in the figure below:

If you want to learn automated testing, I recommend a set of videos to you. This video can be said to be the number one automated testing tutorial on the entire network played by Bilibili. The number of people online at the same time has reached 1,000, and there are also notes that can be collected and communicated with various channels. Master technical communication: 798478386   

[Updated] A complete collection of the most detailed practical tutorials on Python interface automation testing taught by Bilibili (the latest practical version)_bilibili_bilibili [Updated] A complete collection of the most detailed practical tutorials on Python interface automated testing taught by Bilibili (practical version) The latest version) has a total of 200 videos, including: 1. Why interface automation should be done for interface automation, 2. Overall view of request for interface automation, 3. Interface practice for interface automation, etc. For more exciting videos from UP master, please follow the UP account . icon-default.png?t=N7T8https://www.bilibili.com/video/BV17p4y1B77x/?spm_id_from=333.337.search-card.all.click 

2. Enter the text "Beijing-Hongge" in the input box, as shown in the figure below:

 3. Press Enter to turn off recording. As shown below:

4. Find the Variables panel, right-click on the blank space, and click "add variables..", as shown in the figure below:

 5. Enter the variable name and the value of the variable. The value of the variable can be multiple, as shown in the figure below:

6. Click Ok, as shown in the figure below:

 7. Modify parameters and use variables, as shown in the figure below:

 8. Today’s pig’s feet are on the stage: add assertions, select the place where assertions are required (Beijing-Hongge), and click Tools->Add Assertion for Selection, as shown in the figure below:

 9. Modify the parameter variables of the assertion. The value of the assertion here is also the search variable. You can add new variables according to project requirements, as shown in the following figure:

 10. Modify the number of times the script is executed. We choose to loop through the value added when we just defined the variable. As shown below:

  At this point, recording script assertions is all over. Select Run All to try it! Brother Hong has already introduced it here before so I won’t go into details.

11. Start playing back Play All, and the check status on the left side has been successfully changed (a check mark appears at the "Assertion" checkpoint on the left side). As shown below:

 

3. Summary

1. Chinese characters will become garbled when running. Don’t panic. It doesn’t matter. Just change utf8 to GBK.

Guess you like

Origin blog.csdn.net/Faith_Lzt/article/details/132652047