In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "jmeter how to set global variables and regular expression extractor", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "jmeter how to set global variables and regular expression extractor" bar!
In the interface test, many APIs have to take the token after login to send requests normally. Here, record that the login acquisition token is set as a global variable for other APIs to use.
After logging in, there will be a token value in the returned information. Add the regular expression in the post processor to extract token, and then use the BeanShell PostProcessor in the post processor to set token as the global variable.
1. Get the token value:
1.1. grab the bag with fiddler
1.2, F12 view interface information
1.3.Log in to view with jmeter
2. Token is extracted by regular expression:
3. BeanShell PostProcessor sets token as a global variable:
4. Other APIs use this global variable:
Add http header Manager
The regular expression extractor extracts multiple values
The value in the data returned by the previous interface needs to be used in the parameters of the next interface, so the value is obtained through the regular expression extractor.
$1 $, $2 $, $3$ represents the data that matches the first, second and third templates at the same time
Matching number: fill in 1 here, which means that each template value obtains the first matching data.
${id_g1} get the data matched by the first template
${id_g2} get the data matched by the second template
${id_g3} get the data matched by the third template
Thank you for reading, the above is the content of "how jmeter sets global variables and regular expression extractor". After the study of this article, I believe you have a deeper understanding of how jmeter sets global variables and regular expression extractor, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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: 0
*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.