Home > LoadRunner > LoadRunner + QTP = End-to-End performance

LoadRunner + QTP = End-to-End performance

October 2nd, 2009

The easiest way to measure web app performance is just to record a script and run it in HP Controller. Such test is fast and simple, but it’s also incomplete and incorrect. It’s because LoadRunner is not the tool for performance measurements. It’s a tool only for generating the load on the server (Load Runner – tool for “Running” the “Load”).

So how to deal with that?

LoadRunner finishes taking measurements when web page code and all non-HTML elements (jpg,gif,js) are download into the clients memory. But starting from that point the browser need to form UI and display it to the user. And that’s the part that LR is actually skipping. Full end-to-end test should measure time between clicking “submit” button (or whatever triggers a call) and displaying full page within the browser. So how to do it in LR? The quickest answer is “not possible”. For that you need to use QuickTest Professional.

In that case of course you need at least two scripts. One prepared in LoadRunner and second prepared in QTP. Each script will have different task to accomplish. LR script will generate the load on the server simulating different amount of remote users connecting with AUT. QTP script will measure times only for one user, and that’s what we actually need. I believe every single web user care only about how fast page works in his browser. Not how fast it works across all remote users together in average. Of course one is connected with the another.

LoadRunner and QTP have one thing in common – transactions. And basically to measure end-to-end time in QTP all you need to do is to use transactions and remember to synchronize each page correctly. By synchronize I mean to finish transaction when page is fully downloaded and displayed to the user. One solutions for checking when downloading is finished is to call WaitProperty on browser’s status bar element. Example QTP code:

  1. Services.StartTransaction "SUBMIT_PAGE"
  2. Browser("IE").Page("Add_User").Image("Submit").Click 50,16
  3. Browser("IE").WinObject("Status_Bar").WaitProperty "visible", FALSE
  4. Services.EndTransaction "SUBMIT_PAGE"

If you have LR and QTP scripts already in place, now just add them in HP Controller into your scenario. To see QTP scripts in Browse window just change File Type from “Vuser Scripts” into “QuickTest scripts”. One think to remember is that you are allowed to run only single QTP instance at a time so hacks like few QTP scripts running simultaneously are not possible (unless you are using Citrix which is another story).

Only with such scenario you are able to measure full end-to-end performance.

  1. No comments yet.
  1. No trackbacks yet.