In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to use jmeter's if controller". In daily operation, I believe many people have doubts about how to use jmeter's if controller. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use jmeter's if controller". Next, please follow the editor to study!
Let's first take a look at the if controller, meaning: decide whether to execute the request within the controller according to the judgment condition. If it is a string comparison condition, both the parameter and the string need to be quoted.
Conditional format: ${_ _ jexl3 (conditional expression)}:
= = whether it is equal to, for example, ${_ _ jexl3 (${VAR} = = 1,)}, determine whether the ${VAR} variable is equal to 1
! = is not equal to, such as ${_ _ jexl3 (${VAR}! = 1,)} to determine whether the ${VAR} variable is not equal to 1
! No, for example, ${_ _ jexl3 (! (${VAR}! = 1),)} inverts the result of ${VAR}! = 1
& & or | and with or, for example, ${_ _ jexl3 (${VAR} = = 1 & & ${name}! = "heima",)}
> or > = greater than or equal to, such as ${_ _ jexl3 (${count} > = 10,)}
Next, let's take the API to get topic list as an example:
Then set the limit parameter in this interface to a global variable and add a user-defined variable
Then add an if conditional control, logic controller-> if controller to the thread group, and move the interface that gets the list of topics to the controller
Next we need to write expressions in the controller
Next, we run the result and execute the following interface request
Next, we can add a controller and the corresponding request:
If the value we passed in limit is 5, then we will execute the following request 2, and then we will still set the global variable to 1 and check the effect after running it:
As we can see above, only the first request was executed, but request 2 was not executed because the parameters we set do not satisfy the second if controller.
The use of If control can give us more flexibility to use jmeter for interface testing, and automatically execute interfaces that meet our conditions according to the transmission of our parameters, especially some companies may have multiple environments. I wonder if we can also use this method to classify and execute.
At this point, the study on "how to use jmeter's if controller" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 245
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.