本文介绍了正则表达式无法将我的测试场景与jmeter中的viewsate相关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也尝试过使用正则表达式和css/j查询提取器,无法正常运行我的脚本.我的确切测试场景是

I 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. 有一种申请表.
  2. 首先加载页面.
  3. 填充一些数据,然后转到下一页.
  4. 现在再次填写一些详细信息,然后提交.

注意:对于每个申请表",都有两个"9"位唯一编号,它是从服务器端生成的,参与该表格后,有两个选项:
a)访问次数
b)响应计数

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

每次J计量线程组命中页面时,访问计数"都将适当增加,但是响应计数未发生变化,每个用户的计数也应增加.
我已经尝试使用正则表达式和css/j查询表达式来关联参数,但是响应计数"仍然没有增加.在这种情况下,我应该怎么做才能在J米中进行负载测试.
Viewstate正则表达式更改参数

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 expressionChange parameter

正则表达式:input [id = _VIEWSTATE]

Regular Expression: input[id=_VIEWSTATE]

推荐答案

  1. 添加常规Expression Extractor 作为 first 请求的子级.
  2. 配置如下:

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

  • 参考名称:VIEWSTATE
  • 正则表达式:<input type="hidden" name="javax\.faces\.ViewState" id="javax\.faces\.ViewState" value="([^"]+)".*/>
  • 模板:$1$
  • Reference Name: VIEWSTATE
  • Regular Expression: <input type="hidden" name="javax\.faces\.ViewState" id="javax\.faces\.ViewState" value="([^"]+)".*/>
  • Template: $1$

顺便说一句,您可以直接在查看结果树使用RegExp Tester视图的侦听器.

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

这篇关于正则表达式无法将我的测试场景与jmeter中的viewsate相关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!