简体   繁体   English

使用JMeter测试JSF应用程序 - ViewState问题

[英]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

常规Exp提取器

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请求。

第一次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

传递了jsfViewState

The second GET request, now very important in this case. 第二个GET请求,在这种情况下现在非常重要。

第二次GET

The results: 结果:

First GET . 第一次GET On the right we can see value of ViewState. 在右边我们可以看到ViewState的值。

第一个GET结果

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.

无法恢复ViewExpiredException addTourPage.xhtml

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但没有改变。
  • something with JSF apllication? 什么与JSF apllication? When I added context-param com.sun.faces.enableRestoreView11Compatibility into web.xml , there was no ViewExpiredException but the content of returned page was not correct. 当我将context-param com.sun.faces.enableRestoreView11Compatibility添加到web.xml ,没有ViewExpiredException但返回页面的内容不正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM