regular expressionn not able to correlate my test

2019-07-12 22:21发布

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.

2条回答
Fickle 薄情
2楼-- · 2019-07-12 22:51
  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.

查看更多
Bombasti
3楼-- · 2019-07-12 22:54

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.

查看更多
登录 后发表回答