Article From:https://www.cnblogs.com/Lydia25/p/9967670.html

In the daily process of writing automated test scripts, we usually have logic that needs to be judged, so as to control whether or not to do the corresponding operation according to the true or false judgement conditions. JMeter provides some logical controllers (e.g. ForEach controller, transaction controller, if (if)Controller, loop controller, etc.) for our logical control in the automation script. The following is a simple application demonstration of if controller through its corresponding operation, taking the collection interface test case of Exun App as an example. The demonstration operation is as follows:

  1. Search commodities by commodity number and get corresponding commodity system number.
  2. The corresponding collection number is queried in the collection list by the commodity system number.
  3. Determine whether the collection number exists. If it exists, delete it and verify that the deletion is successful.
  4. Collect merchandise.
  5. Verify the success of the collection.
  6. Collect the merchandise again to verify the correctness of the reminder information for duplicate collection.
  7. Delete collection items from the collection list.
  8. Verify that the collection was successfully deleted.

Here’s a brief description of step threeLogic controller MediumIf Controller The way of use. AddIf ControllerThe steps are as follows: [Add/Logic Controller/If Controller], the interface of the controller is as follows:

  

  • Name: Brief description of IF logic controller.
  • Note: A detailed description of the logic controller.
  • Conditions: Judging conditions, you can refer to variables. When true, the response operation is performed.

The IF logic controller configured in the third step is as follows:

  

 

 The final script execution results are as follows:

   

 

From: http://www.cnblogs.com/fengping fan

Link of this Article: Jmeter(16)IF Controller

Leave a Reply

Your email address will not be published. Required fields are marked *