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 (before starting, read http://wiki.apache.org/myfaces/PerformanceTestingWithJMeter). 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.

Extract the ViewState
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 Match No to 0.
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.

Change the dynamic variable
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}

JSF_test_with_SUN_implementation (last edited 2009-09-20 21:56:33 by localhost)