Interface testing - the application of test fragments of Jmeter

1. What is a test fragment?

A special kind of thread group on the controller, which is at the same level as the thread group. The difference with thread groups is that test fragments are not executed. It is executed when it is a module controller or is applied by a controller. Usually used with Include Controller or Module Controller.

1.1 So what does it do?

  1. When the jmeter script is very complex, use cases can be managed by test fragments and modules
  2. When the jmeter script is completed by multiple testers, the use cases are managed by dividing the test fragments into modules

1.2 Then how do I use the controller to call it?

1. Right-click the test plan -> add Test Fragment

2. Under the test fragment, organize the test case script;

3. Save the test fragment script. Select File—>Save Test Plan As—>Save to Local.

4. For the use cases organized by other modules, follow the steps 1, 2, and 3 above to create and save them in the same way.

现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:110685036

 

Two, use the Include Controller to call the test fragment

The Include Controller can directly refer to the jmx file saved by the test fragment, but if you use the cookie manager or user-defined variables, you need to put these variables in the top-level test plan instead of the included jmx file, otherwise it cannot be guaranteed to work properly.

Re-open a jmeter window, add thread groups, user-defined variables, Include Controller, and view the result tree.

1. Set the user-defined variables to access the ip and port

2. Select the locally saved test fragment script in the Include Controller

ps: The scripts of these test fragments can be centrally managed in the bin directory of jmeter, and create a new project folder in the bin directory to realize centralized management of test cases; modify it to a relative path in Include Controller

3. Run, view the result tree to see the test results

3. Use the module controller to call the test fragment

Module controllers provide a mechanism for replacing test fragments with the current test plan at runtime. Test fragments can be located in any thread group.

1. Open a jmeter window, add thread groups, user-defined variables, module controllers, test fragments, and view the result tree.

2. User-defined variables also define access ip and port numbers. The following user modules and recharge modules are test fragments

3. There are multiple test segments in the same thread group, and you can easily switch between these multiple test cases just by selecting the appropriate controller from the module controller drop-down box. But note that these fragment names must be unique.

  1. If the module controller only selects the user module, only the test fragment of the user module will be run

  1. The module controller only selects the recharge module, and only runs the test fragment of the recharge module

4. If a fragment is in a thread group and is runnable, its Controller needs to be disabled to prevent the fragment from running, except for the module controller.

operation result:

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 use your mobile phone to do the quizzes, 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/132154713