2
votes

I want to stress test my jsf application (using Primefaces) with Jmeter and i'm facing a strange (yet expected) problem.

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.

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.

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.

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.

Is there anyone else that solved this problem somehow?

Thanks in advanced!

1

1 Answers

0
votes

Before you send a request I get the first screen with a GET method, keep the id with regular expression. Then I'll send the request. For each new screen that opens has to resave the viewState overwriting the previous one.

  • [simple contoller]
    • [html request]open view e save viewState(method GET)
      • [regular expression extractor] extract ${myViewState}
    • [html request]your request sending ${myViewState}
    • .
    • [html request]OTHER open view e save viewState(method GET)
      • [regular expression extractor] extract ${myViewState}
    • [html request]your OTHER request sending ${myViewState}

...for each new screen that opens has to resave the viewState overwriting the previous one.