[英]Testing JSF application with JMeter - ViewState issue
All day I try to run JMeter tests of my JSF application. 我整天都在尝试运行JSF应用程序的JMeter测试。 I am aware of
ViewState
, but it seemed to be quite simple issue. 我知道
ViewState
,但它似乎是一个非常简单的问题。 I prepared Regular Expression Extractor: 我准备了正则表达式提取器:
Reference Name: jsfViewState
Regular expression: id=\"javax.faces.ViewState\" value=\"(.+?)\"
Template $1$
Match No. 1
The following samplers are created with proxy and recording. 使用代理和记录创建以下采样器。
First request /TourJSF/pages/protected/admin/addTourPage.xhtml
. 首先请求
/TourJSF/pages/protected/admin/addTourPage.xhtml
。 This is GET
request from which ViewState will be extracted. 这是将从中提取ViewState的
GET
请求。
The POST
request /TourJSF/pages/protected/admin/addTourPage.xhtml
where . POST
请求/TourJSF/pages/protected/admin/addTourPage.xhtml
在哪里。 ${jsfViewStete}
is passed into javax.faces.ViewState
${jsfViewStete}
被传递到javax.faces.ViewState
The second GET
request, now very important in this case. 第二个
GET
请求,在这种情况下现在非常重要。
The results: 结果:
First GET
. 第一次
GET
。 On the right we can see value of ViewState. 在右边我们可以看到ViewState的值。
Debug Sampler
which shows that jsfViewState value is correct. Debug Sampler
,显示jsfViewState值是否正确。 We can compare it with the previous screen. 我们可以将它与之前的屏幕进行比较。
javax.faces.application.ViewExpiredException: viewId:/pages/protected/admin/addTourPage.xhtml - View /pages/protected/admin/addTourPage.xhtml could not be restored.
I found some blogs and topics about this issue but many of them were unsolved. 我找到了一些关于这个问题的博客和主题,但其中很多都没有解决。 If it is needed I can put links to these topics.
如果需要,我可以链接到这些主题。 I am really confused...
我真的很困惑......
Where is the issue? 问题在哪里? Maybe something with
也许有些东西
jsessionid
? jsessionid
? HTTP Header Manager
in every HTTP Request
? HTTP Request
HTTP Header Manager
? I deleted HTTP Header Manager
but nothing changed. HTTP Header Manager
但没有改变。 com.sun.faces.enableRestoreView11Compatibility
into web.xml
, there was no ViewExpiredException
but the content of returned page was not correct. com.sun.faces.enableRestoreView11Compatibility
添加到web.xml
,没有ViewExpiredException
但返回页面的内容不正确。 Aren't you missing a Cookie Manager ? 你不是错过了Cookie管理器吗?
See: 看到:
Also read this: 另请阅读:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.