Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use jmeter regular expressions

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to use jmeter regular expressions". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use jmeter regular expressions.

By using the Jmeter regular extractor, the desired content can be obtained from the response result of the request, thus the correlation can be realized.

Association means that there is a data dependency between the request and the request, and you need to get the data that the next request needs to send back from the previous request.

To find the corresponding data in the view result tree, we need to get the actionId,buttonName

You need to select the request right button and add-post processor-regular expression extractor (on which request you need to get it in the response data of the request. The post processor means that the request is executed first and then fetched from the response data)

As shown in the figure above, this is the property of a regular expression. First, briefly introduce the meaning of the following field, and then give an example.

Name: just write one yourself.

Apple to: and the corresponding fields to be checked are generally defaulted. They are mainly processed for the values in the response data. For other needs, please refer to the jmeter description.

Reference name: the name of the variable defined by yourself, and the name of the variable to be referenced in subsequent requests, such as: actionId, followed by ${actionId}

Regular expression: a regular expression that extracts content, equivalent to an association function in lr

[the part enclosed by "()" needs to be extracted, and the content you want to mention needs to be enclosed in parentheses]

[".": matches any character except a newline character]

["*" (greedy) repeat zero or more times, for example, "aaaaaaaa" matches all a regularities in the string: "a *" will go to all characters "a"]

["+" (lazy) repeat one or more times for example, "aaaaaaaa" matches all a-regularities in the string: "a +" takes all a characters in the character, "a +" differs from "a *" in that "+" is at least once while "*" can be 0 times]

["?" (possession) repeat zero or once, for example, "aaaaaaaa" matches the a-regular string: "a?" It will only match once, that is, the result is only a single character a]

["*?" Repeat any number of times, but repeat as few times as possible, for example, "acbacb" regular "a. Acb" will only get the first "acb", but when a qualifier is added, it will only match as few characters as possible, and the result of the minimum number of characters of "acbacb" is "acb"]

["+?" Repeat one or more times, but as little as possible, with "*?" The same, but only to repeat at least once] there are also grouping cases, these are the only two commonly used, and the others can be used on their own Baidu.

["(? = exp)" matches the position in front of the exp]

["(?

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report