jmeter extraction using regular expressions dependent parameter

1: Log Interface

There is a real login interface returns a string token in the response, as FIG.

So our next interface - experiences library list, it must be brought into this string token, or in response error, as shown below   

 

 

How to get the password to log it? Here to explain in detail, as shown in Figure  

In the next interface may be acquired as a token call variable, the variable named $ {center-token}, following FIG.

 

Observation request header, a string of the incoming token found, and the result is correct response

 

 

 Since then, a full sign association ended. Follow interfaces directly call the token on it. We then went on to say other associated parameters

For example, a CRUD process, want to do automated inspection must form a closed loop, then delete - modify - view it is necessary to call the same required parameters, such as the uniqueness of id. The following examples demonstrate or   

I would like to experience a new library, you can see the results in a return to the id, I have to call this uniqueness of id in subsequent interface

Next, write a positive then it is removed before the token attention and regular differences

Subsequent interface may call this parameter, and correct response

  

Well, a complete login - View - deletion process here can end up ~ Here is the end of the egg

Above regular it is to get a single parameter, so if you want to pass a set of parameters for how to write it?

Modify the regular expression

The results can be seen in a whole array passed  

Regular Expressions Brief Description:

() Square brackets is the need to extract, for you need to mention the contents enclosed in parentheses

. Dot indicates match any string

+ Means one or more matches, which matches all *

? After finding the first match is stopped without? Find a match represents the last stop

Template : with reference $$ up, if there are a plurality of regular expressions (s bracketed stuff), it may be $ 2 $, $ 3 $ and the like in the regular expression, showing an analysis of several values to to user_id. For example: $ $ 1 represents the first value to match

匹配数字:0代表随机取值,-1代表所有值,此时提取结果是一个数组,其余正整数代表第几个匹配的内容提取出来。如果匹配数字选择的是-1,还可以通过${XX_1}的方式来取第1个匹配的内容,${XX_2}来取第2个匹配的内容

Guess you like

Origin www.cnblogs.com/nadian/p/12061131.html