Loadruuner Helpline by Bhupendra Varshney, Loadrunner Help online, Loadrunner issues

Welcome To Loadrunner Helpline By Bhupendra Varshney

Tuesday, April 26, 2011

VU Gen (Virtual User generator)

Hello Friends,

The wait is over now. After a long span of 1 year, upon many of my follower's request through mail, I am back with new ideas on treasures of Loadrunner. Before start explaining the concept of VU Gen, I would request you to please read out my previous two blogs on Web Performance Testing and Components of Loadrunner.... Uhhhh....typing up whole Loadrunner is too lengthy..is'nt it?? So we will refer LR to Loadrunner... :-)....

VUGen is a component of LR used to perform the recording a script. A script is nothing but an end-to-end functionality of a business process. But the question is how to find out the optimum script flow for an application and who provides that, are the key questions one may raise. I will cover this in Performance Test Planning. For now I will put more light on the script flow.

Let's take an example of a third party transfer functionality of net-banking application (of course web application in our context) to more understand the end-to-end functionality. In a net-banking application, the user will first type in the URL in the address bar of Web browser. After page appears he will login to the application and will be able to see his main page. Next he will go to Fund Transfer (term may vary for different websites) and then he will select third party transfer (with-in bank) and  then he will select 1) "from account" from dropdown (source account from which the fund has to be transfer), 2) To account (destination account beneficiary) and then he will enter the amount in the Text box and then click Pay button. He will get the success message from the server for the transaction. (some must be thinking what if the transaction fails, then the answer is - we always record the script with functionally valid build and valid data). After that the user will Logout.


Actions

So on nutshell, the script's steps (flow) will be as follows -


Home Page-->Login button--> Fund Transfer--> Third party transfer Link -->Submit Details Button --> Logout

Here the above six flows are called as six actions of third party transfer script. After we are done with the identification of the business flows we will start recording the script.

Parameterization:

The above steps of a script are captured in separate section (as a function) in the VUGen. After we record the script, we select for the static values (the values which a user has to enter manually). These static values will then be parameterized in order to simulate  the multi-user load (for example for 100 user test we have to parameterize User ID and Password field and save the parameter file (dat file) with 100 different User IDs and Password.

After we are done with parameteization we will start correlation.

Correlation

Correlation is the core of the scripting. When we record the script, some dynamic values (generated by the server dynamically) are recorded and hard-coded in the script which need to be correlated so  that it gets changed for every iteration. The example of such dynamic values are -Session ID, UID, SID, JSession ID..the IDs which are unique for a single iteration and gets expired with the session of a user.

One function fulfills this need of correlation -

web_reg_save_param("Parameter Name",
"LB=Left Boundary",
"RB= Right Boundary"
"ORD=Ordinal on which the value falls",LAST);



Content Check


After correlating the dynamic values, we check for the success of our page. We find out some string (text) on the page which appear on the success of an action. For example, when we logout from the appilcation, an appilcation gives a message - "You have been successfully logged out".
 
We will set this value to be a symbol of pass criteria of our transaction (will explain you later).
 
This content check will be  used for error handling of our script.
 
One function is used for this -
 
web_reg_find("Text=Text To Be find");
 
Think Time


Think time is the time a user takes to think while performing some action (enter detail, clicking a button etc);

We use the following function for applying  the think time between two transactions.

 lr_think_time("number");

To be continued.....