RM123
RM123

Reputation: 3

How to add regular expression extractor for more than 1 viewstate in jmeter for asp.net page

I have 10 different __viewstate values in jmeter script. one is for login and others are for post methods. how can i use regular expression extractor to parameterize the viewstate for performance testing.

Upvotes: 0

Views: 579

Answers (2)

RaGe
RaGe

Reputation: 23707

As per regular expression extractor documentation:

If the match number is set to a negative number, then all the possible matches in the sampler data are processed. The variables are set as follows:

  • refName_matchNr - the number of matches found; could be 0
  • refName_n, where n = 1,2,3 etc - the strings as generated by the template
  • refName_n_gm, where m=0,1,2 - the groups for match n
  • refName - always set to the default value

Set match number -1 for one expression to return all matches from the response.

Upvotes: 1

vins
vins

Reputation: 15390

As RaGe mentioned in the comment, you can just use 1 Regular Expression Extractor to find all the matches for the given pattern.

Regular Expression Extractor - Example

MatchNo :

  • 0 for random
  • 1 for first match
  • 2 for second match and so on.
  • -1 for all matches

When you enter -1 & get all matches, to access the first match, use TheVariableName_1

Upvotes: 0

Related Questions