简体   繁体   English

使用Jmeter + JSF + Primefaces

[英]Using Jmeter + JSF + Primefaces

I want to stress test my jsf application (using Primefaces) with Jmeter and i'm facing a strange (yet expected) problem. 我想用Jmeter对我的jsf应用程序(使用Primefaces)进行压力测试,而我遇到了一个奇怪的(迄今尚可)问题。

The jmeter setup i'm using is good and working and it's using a Regular Expression Extractor to get the view state, a HTTP URL Re-writing Modifier for the JSESSIONID, a HTTP Cookie Manager and a Recording Controller. 我使用的jmeter设置很好并且可以正常工作,它使用正则表达式提取器来获取视图状态,用于JSESSIONID的HTTP URL重写修改器,HTTP Cookie管理器和记录控制器。

The recorded scenario i want to use is going to a page with some Primefaces dynamic tabviews and inside that tabs there are PF command buttons that are used to save data. 我要使用的录制场景将转到带有一些Primefaces 动态选项卡视图的页面,并且该选项卡中有用于保存数据的PF命令按钮。

Now the problem is this: when i replace the recorded ViewState with the variable holding the one extracted by the regular expression the page with the tabviews fail to navigate to other tabs (and can't render the save button) so the page can't simulate saving. 现在的问题是:当我用保持正则表达式提取的变量替换记录的ViewState时,带有tabviews的页面无法导航到其他选项卡(并且无法呈现保存按钮),因此该页面无法模拟保存。

What i figured out is that when you change tabs in dynamic tabview, Primefaces do a ajax request with a new viewstate and subsequent POST requests must use this viewstate to understand the changed tab. 我发现的是,当您在动态选项卡视图中更改选项卡时,Primefaces会使用新的viewstate进行ajax请求,随后的POST请求必须使用此视图状态来了解更改的选项卡。

Is there anyone else that solved this problem somehow? 还有其他人以某种方式解决了这个问题吗?

Thanks in advanced! 提前致谢!

Before you send a request I get the first screen with a GET method, keep the id with regular expression. 在发送请求之前,我使用GET方法获取第一个屏幕,并使用正则表达式保留id。 Then I'll send the request. 然后,我将发送请求。 For each new screen that opens has to resave the viewState overwriting the previous one. 对于每个打开的新屏幕,必须重新保存viewState,以覆盖前一个屏幕。

  • [simple contoller] [简单的控制器]
    • [html request]open view e save viewState(method GET) [html请求]打开视图并保存viewState(方法GET)
      • [regular expression extractor] extract ${myViewState} [正则表达式提取器]提取$ {myViewState}
    • [html request]your request sending ${myViewState} [html要求]您的要求传送$ {myViewState}
    • .
    • [html request]OTHER open view e save viewState(method GET) [html请求]其他打开视图并保存viewState(方法GET)
      • [regular expression extractor] extract ${myViewState} [正则表达式提取器]提取$ {myViewState}
    • [html request]your OTHER request sending ${myViewState} [html请求]您的其他请求发送$ {myViewState}

...for each new screen that opens has to resave the viewState overwriting the previous one. ...对于每个打开的新屏幕,必须重新保存viewState来覆盖前一个屏幕。

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

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