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:
- Search commodities by commodity number and get corresponding commodity system number.
- The corresponding collection number is queried in the collection list by the commodity system number.
- Determine whether the collection number exists. If it exists, delete it and verify that the deletion is successful.
- Collect merchandise.
- Verify the success of the collection.
- Collect the merchandise again to verify the correctness of the reminder information for duplicate collection.
- Delete collection items from the collection list.
- 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