Template for Help Pages
Testing a SUN RI JSF Application with JMeter
The JSF RI implementation is similar to the MyFaces except the hidden field has a different name. The steps are the same that explained in PerformanceTestingWithJMeter in the MyFace Wiki : in order to simulate the JSF ViewState request parameter, set up JMeter to record your request/response streams and use the scripts JMeter creates as a starting point. To simulate the ViewState parameter create a JMeter RegEx Extractor. Apply the extractor to the Thread Group. Set the reference name as: jsfViewState. The RegEx is different than with MyFace, use <input type="hidden" name="com\.sun\.faces\.VIEW" id="com\.sun\.faces\.VIEW" value="(.?)" /> instead of <input type="hidden" name="javax\.faces\.ViewState" id="javax\.faces\.ViewState" value="(.?)" />. Set the template to $1$ and 0 in Match No.
This extractor will find the ViewState parameter and store it in a JMeter variable called jsfViewState so it can be passed down in future requests. Modify the recorded HTTP Request for all JSF requests using the POST method. Replace the value of the parameter com.sun.faces.VIEW with ${jsfViewState}