Jmeter parameterization - loop assertion multi-method

1. Parameterized interface test data

Note: The csv document is parameterized, how many pieces of data there are in it, how many times must be looped in the thread group, otherwise it will only be executed once

2. Add configuration element - counter

About counters:

①Starting Value:给定计数器的初始值;
②递增:每次循环迭代后,给计数器增加的值;
③Maximum Value:计数器的最大值,如果超过最大值,会重新设置为初始值,非必填项;
④数字格式:可选格式,比如填写000,格式化为001,002;比如填写0,格式化为1,2;
⑤引用名称:引用变量,可以在其他元素中引用该值,形式:${引用名称}

⑥与每用户独立的跟踪计数器:
不勾选,即全局计数器的,比如用户#1 获取值为1,用户#2获取值还是为1;
勾选,即独立的,则每个用户有自己的值:比如用户#1 获取值为1,用户#2获取值为2。

⑦每次迭代复原计数器:只有当勾选了,与每用户独立的跟踪计数器时才可用;
勾选此选项后,则每次线程组迭代,都会重置计数器的值,当线程组是在一个循环控制器内时比较有用。

Splicing functions, nested variables:

This is a function that comes with Jmeter. You can use this function to splice strings, or nest variables in variables.

Name of variable: The referenced variable name Default value: Non-mandatory parameter, after filling in, when you fail to reference the variable, the default value will be filled

3. Set assertion content - add user-defined variables

A very important point here is that we need to set the content that needs to be asserted as a variable, because only in this way can we loop through values ​​and make loop assertions

4. Add a JSON extractor, and the extraction interface returns the data for judgment

5. Add a response assertion to judge the result

6. Add view result tree and make circular assertion

According to the assertion, one of the use cases failed to execute, because the returned respCode is 3100, and the response assertion is set to 3104

The following are supporting learning materials. For friends who do [software testing], it should be the most comprehensive and complete preparation warehouse. This warehouse also accompanied me through the most difficult journey. I hope it can help you too!

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can do quizzes on your mobile phone, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

Information acquisition method:

Guess you like

Origin blog.csdn.net/jiangjunsss/article/details/132305960