Jmeter parameterization file format combat -csv

【background】

Jmeter Version: 5.1.1

Demo: aggregate data - Lottery results of the query (https://www.juhe.cn/docs/api/id/300)

Last week got in txt format file parameterization, busy today, working to csv file format is also under parametric comb.

[Gymnastics]

In fact, csv file format parametric and parametric operating txt file format or less, but here it is recommended that you use csv format file is parameterized, because it looks more intuitive and more.

The following specific operation!

Jmeter parametric -csv format

Step 1: Interface document data aggregation lottery results query the first to see the next, we can see three request parameters: key, lottery_id, lottery_no, where the key, lottery_id is mandatory parameters, lottery_no non-mandatory parameter.

Step 2: Test Plan New thread group (such as the name lottery), and in turn add that thread group - Sampler - HTTP requests (such as name Gets Lotto lottery results), fill out the parameter information.

 

Step 3: sequentially added at that thread group - Listener - View Results Tree, a single request for viewing the results of the operation.

Here we run it, the interface can be found in the request is successful, the query to 20,001 lottery data.

 

 To further validate the interface request to return the results are correct, we can add assertions for verification.

 From the response data to see the results of the tree can be seen in "reason": "Query successful", so here we add in response to the assertion, in response to the test field contains the text "Query successful" button.

 

 Run again, the assertion by not being given the information indicates that the interface returns to normal. Under assertion can try to respond under "Query successful" to "see success", run to see what results again?

___________________________________________________________Dividing line____________________________________________________________________________________

Thoughts: Get award-winning data only 20,001 of us here, if it is to get all the big lottery winners 2019 data, then, to how to deal with it?

Well, finally to today's topic, and that is parameterized by management csv file format, as shown below, input parameter data in csv table:

 

lottery_id and lottery_no is need to pass parameters, here we need to get 2019 20 Lotto lottery information.

Thread group sequentially added - Configuration element - provided the CSV data file, import the local csv file format: Step 4. Set lottery_id and lottery_no variable name.

 

 Step 5: modifications HTTP request corresponding to the value of the parameter name, acquired by $ {lottery_id} csv table test data and $ {lottery_no};

 

 Step 6: Thread the group changed to 20 cycles, click Run, see the following chart success after

 

 

 

If in doubt, please share, I am also learning. Where there is not an article, please advise!

 

Guess you like

Origin www.cnblogs.com/mrgavin/p/12606290.html