Tarit Ray
Tarit Ray

Reputation: 994

regular expressionn not able to correlate my test scenario with viewsate in jmeter

viewstate valueenter image description hereI have tried with regular expression also with css/j query extractor,not able to run my script properly. My exact test scenario is kind of

  1. There is kind of application form.
  2. First Load the page.
  3. Fill with some data, then go to next page.
  4. Now again fill some details, and Submit.

Note:For Each and every 'application form' there is two "9" digit unique number , which gets generated from server side, and after participating the form there is two options:
a)Access Count
b)Response Count

Every time J meter thread group hits the page 'Access count' properly gets increased , but Response Count not gets change, it should get increase for each user as well.
I have tries to correlate both the parameter using regular expression and css/j query expression , but still the 'Response Count' not gets increment. What should I do for this case to do Load test in J meter.
Viewstate regular expression Change parameter

Regular Expression: input[id=_VIEWSTATE]

While Checking the response data in

result tree its showing different in Load page and next Page.

Upvotes: 2

Views: 373

Answers (2)

Dmitri T
Dmitri T

Reputation: 168092

  1. Add Regular Expression Extractor as a child of the first request.
  2. Configure it as follows:

    • Reference Name: VIEWSTATE
    • Regular Expression: <input type="hidden" name="javax\.faces\.ViewState" id="javax\.faces\.ViewState" value="([^"]+)".*/>
    • Template: $1$
  3. Refer extracted value as ${VIEWSTATE} where required.

By the way, you can test your Regular Expressions right in View Results Tree listener using RegExp Tester view.

Upvotes: 1

Aajan
Aajan

Reputation: 937

The regular expression is wrong. input[id=_VIEWSTATE] can' t capture a value. You can test it in regular expression tester of response.

It may be something like: input[id=(.*?)] It depends on your dynamic value. But in question you didnt mention screenshot of that dyanamic data.

Upvotes: 0

Related Questions