24 Ağustos 2010 Salı

Testing JSF Applications by JMeter

JMeter is quite good tool for stress / load testing.In JMeter there are various request types like http request , soap request for testing. These request are sent by threads . Increasing number of threads will increase the load on your application.I will explain how to test JSF applications by JMeter . For regular jsp's it is easier to test becasue there is no jsessionid or another jsf specific parameter.
First I will introduce my web application. It is just a simple login form which is consist of username and password.Run JMeter , first create a thread group. We will add requests,cookie manager and regular expression extractor into the thread group.First retrieve the login form so we can get jsessionid and javax.faces.ViewState input.


As you can see I defined servername, serverport and address of page.Then we will add cookie manger for jsessionid.


Cookie Manager is added and rfc2109 is selected as a cookie policy.Now we have to add regular expression extractor for javax.view.state parameter.If you don't retrieve this value and post it , your action will be failed.



Now we have to post username , password and some jsf specific data .It is similar to the first request. Parameter names should be encoded.


In the end add "View Result Tree" so you can see request and response .

1 yorum: