Jmeter (33) - From entry to mastery - Jmeter Http protocol recording script tool - Badboy6 (detailed tutorial)

1 Introduction

What I share today is to explain and share based on the previous article: Badboy uses the data source Excel to parameterize the script. Then use the read parameters to make a comparison assertion.

2. Specific scenarios

Badboy records a search script and asserts the search content, and then parameterizes the search content and assertion content respectively. The parameters do not set specific values. The specific values ​​must be read from Excel. After reading the value, the search content is read. The first column of Excel, the assertion content reads the second column of Excel. The general scenario is like this. Let’s take a look at how to implement it.

3. Specific steps

1. First create a new Excel. The example I wrote here is very simple. It consists of two columns of data, and the first line is the header. As shown below:

2. Record the script. See the previous article to record a very simple Sogou query. Here Hong will use the script recorded in the previous article to demonstrate. If you are not sure, you can read Brother Hong’s previous article.

3. Add a data source (the method is the same as adding the Variable Setter explained earlier). Find the Data Source in the Tools panel and drag it to the front of the step. Remember: it must be placed at the top because the data needs to be loaded first during runtime, as follows As shown in the figure:

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

5. Then double-click Load data from to configure the data source, select 12 (this is created by yourself, you will know why at the end), as shown in the figure below:

 6. Select sheet1$ and click "OK", as shown in the figure below:

7. Select sheet1 and check the variable name, as shown in the figure below:

8. Modify the query parameter to username in Excel, as shown in the figure below:

 9. Modify the assertion parameter to password in Excel, as shown in the figure below:

10. Modify the number of executions to the number of values ​​of the loop username, as shown in the figure below:

 

11. At this point, all preparations are done and play All can be run.

4. Summary

1. Careful children or friends will surely find that the drop-down selection of Hongge’s Attach variable data sources is blank and there is no Excel file option. How to solve this problem. As shown below:

 Workaround: Create a data source in the Administrative Tools of Control Panel. The version of Badboy I use is BadboyInstaller-2.1.2_wm. According to actual testing, the 64-bit data source cannot be recognized, so a 32-bit data source should be created:

1. Open Control Panel->Administrative Tools, as shown below:

  2. Double-click "ODBC Data Source (32-bit)", as shown in the figure below:

3. In the user DSN tabl, click "Add", as shown in the figure below:

 4. Select "Microsoft Excel Driver (*.xls)" as the driver and click "Finish". As shown below:

5. Fill in the data source name Excel and click "OK". As shown below:

 

Guess you like

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