Wednesday, June 25, 2014

Being / Becoming a Performance Tester


If you wanted to become a performance tester or make your career in performance testing, below are the important characteristics that you need to have:

Common Sense and observation
There are several jobs which do not require applying common sense or minute observation skills. But Performance testing is not definitely one of those. You should have lot of observation as well as common sense.

Jump into the shoes of others:
The performance testing job expects you think from the various perspectives like from the customer / end user point of view, from the business point of view / from the application / technology point of view etc.  While automating the use cases you should think from the end user perspective. When providing a performance test report, you should ensure that the report can be understood for the business analysts as well as the one who owns the entire business. While analyzing the root causes for the performance issues, you should imagine yourself as a technologist.

Willingness to Learn:
Learning performance testing is not one time activity, though the basics remain the same. With the new technologies emerging pretty quickly, as a performance tester you should upgrade yourself to the new technologies and understand the core of them. Continuous learning is the one vital factor that makes a performance tester career prolonged.

The above said are the basic things needed. However, to start your career as a performance tester below is the technical stuff that you should have at least basic understanding about
Operating systems: How operating systems work, the CPU scheduling, memory management, disk management etc
Databases: The tables, queries, joins and indexes and how a query is executed
Computer networks: How the communication between the client and server happens, the TCP, UDP communications, HTTP
Web Application architecture and browser properties: Web, App and DB Servers, the way they work, some important features of web applications like session ID, cookies, request methods and response
Any programming language – You should be good in writing the basic programs with any one programming language

So, if you are considering a career in performance testing, ensure you have all the above said requirements met.

Monday, June 9, 2014

Understanding Randomization in LoadRunner

Randomization is a common practice with majority of the performance test scripts, where dropdown / Radio buttons / Links has to be chosen by the user randomly.

For example the application requires choosing a value from the drop down randomly, then the important thing is to know how many values are there in the drop down and what their values.

We all know the web_reg_save_param() or web_reg_save_param_ex() function has to be used to capture the values. Now, because we need all the values we'll specify the attribute "ORD=ALL" / "Ordinal=all". Assume that the function is written as below:

web_reg_save_param("DropdownValues", "Lb=<option>","rb=</option>", "Ord=all", LAST);

When the above function is executed, LoadRunner creates N+1 LR variables if there are N values in the drop down.

The first drop down value will be saved to an LR variable named "DropdownValues_1" and the second value from the drop down will be save to an LR variable named "DropdownValues_2" and so on. The total number of matches / count would be saved to another parameter called "DropdownValues_count".

The function used to choose a random value is lr_paramarr_random(). This function returns an address location of the random parameter.

In our example the function should be used as:

char * randVal;


randVal = lr_paramarr_random("DropdownValues");

As the variable randVal is C string variable, cannot be used in protocol functions,  this has to be converted to an LR parameter using below statement (for details on why, please refer to variable conversion in LoadRunner).
lr_save_string(randVal, "RandDropdownVal");

When lr_paramarr_random("DropdownValues") is seen the script, the script immediately checks if there is a parameter named "DropdownValues_count" and tries to retrieve its value. If this parameter is not available, an error would be thrown.

Assuming that the count is 10, now it generates a random value between 1 -  10 and refers to the corresponding address location. i.e. if the random number is 6, it searches if there is an LR parameter called "DropdownValues_6", if yes,  its address location is returned to the string variable.

If there is no such parameter, it would throw a warning saying that "The string with parameter delimiters is not a parameter"

Hence it is very important to capture all the values using the web_reg_save_param() function with the ORD attribute set to ALL if at all the parameter has to be used for randomization.

In the next article, we will see how we can utilize this behavior in building a custom C function that works similar to web_reg_save_param() with ORD being set to ALL.