Jmeter (xv) regular expressions to extract the parameters

1: Jmeter regular expression extractor to extract values developed
http response data are as follows:

 

1.1: add http requests (port 80 without writing the port number)

 


1.2: Adding regular expression extractor
. Means match any character

+ Represents one or more matches

? It indicates a match to the end

PS: The following regular expression can also be written province: '([^'] +) ',

        He represents: [^ '] is not matched to the single quotation marks'; + represents a plurality of characters within it

 

 

1.3: Sampler added Debug
(Debug sampler with a tester can easily see which system variables)

 

 

 

1.4: adding "observation tree"
. 1: HTTP Request -> response data as follows

 

 

2: Debug Sampler -> response data as follows

 

 

 

1.5: reference variable extraction
1: for example, the following figure: We value assigned to the former debug name of city

 

 

2: Name observed before the debug sampler as "Beijing" represents the value of the city is to take the (Also: value city_g1 also "Beijing" So take city_g1 variable is the same result)

 

 

2: Jmeter plurality of variable matching
PS: The following embodiment is only for single-line mode (ie: no return data if the wrap herein refer to Chapter 4 for the case of data with a return linefeed first chapter)
2.1 Http request to add

 


2.2 http response data was as follows

 

2.3 Add the regular expression extractor 
as follows: the introduction of a variable named value; the introduction of templates

 

 

Tree View Results 2.4 Observations
1: observe debug results sampler

 

 

 

3:引用Jmeter正则表达式提取器提取的值
3.1 示例:在Debug取样器命名上提取的值
引用第二章的结果 ;在debug取样器上取value_g2和value_g1的值

 

 

 

3.2 观察结果树

如下图 debug取样器的结果树中就会显示取值结果

 

 


原文:https://blog.csdn.net/hujyhfwfh2/article/details/80551299     作者:AnndyTuo 

Guess you like

Origin www.cnblogs.com/sunyale/p/11206979.html