Performance Testing LDAP + Web Applications with JMeter 2.3.2

While frameworks like CakePHP can automate unit tests, JMeter is a great tool for regression and performance testing because of the wide range of samplers (such as HTTP, FTP, LDAP).

I use JMeter to performance test an application that stores user data in a back end LDAP database. This is how I set up my script.

First create a Test Plan. This is created by default. Right click on the Test Plan, and add some Config Elements. If your application uses Cookies, add the HTTP Cookie Manager. There was a bug in JMeter 2.3.1 that meant that cookies would not clear correctly – upgrading to 2.3.2 will fix that.

Add HTTP Request Defaults Config Element. This means you don’t have to enter this information per each sampler. A note about the path – if your application is /folder/logon.jsp then you cannot set the path to be “/folder/”, and in each respective sampler type for instance “logon.jsp”. It doesn’t work (for me). I leave the path blank, and refer to the full path in each particular sampler.

Add HTTP Header Manager if you’d like to send different headers to your application. In this example, I send a value called userid with the variable ${userid}. This is useful to trace through web server logs for instance. Do note some proxies strip out headers they don’t recognise, and so using existing headers like User-Agent.

Since my application uses LDAP, I’ve added an LDAP Request Defaults Config Element. The documentation around using LDAP is pretty lightweight, so this is what works for me as request defaults.

I also added a LDAP Extended Request Defaults, since I do some LDAP requests that are outside the normal tests (like resetting user accounts).

And here’s a Login Config Element that provides the username and password forh the LDAP Request Defaults Config Element.

Next I add Listeners. Listeners do something with data from your application, like graph it, or save it. Some of the most useful ones are:

  • View Results Tree – Great for viewing particular failed requests, also has the ability to render HTML and XML.
  • View Results in Table – Good way to see at a glance what tests passed or failed.
  • Summary Report – Great to see average, minimum and maximum response times, error percentage, and throughput.

Stay tuned for the next post which will talk about adding Samplers to do the heavy lifting of your performance testing.

Leave a Reply

Your email address will not be published.