Skip to main content

Posts

Showing posts from 2013

Pacing Time in LoadRunner

What is Pacing? Where and why to use it? -Pacing is the time which will hold/pause the script before it goes to next iteration. i.e Once the   Action   iteration is completed the script will wait for the specific time(pacing time) before it starts the next one. It works between two actions. eg, if we record a script there will be three default actions generated by the Load Runner:   vuser_init, Action   and   vuser_end,   the pacing will work after the   Action   block and hold the script before it goes to repeat it. The default blocks generated by LoadRunner is shown below: Actions marked in Red Now we know what is pacing and we use it between two iteration. The next question comes to mind is why we use pacing: Pacing is used to: To control the number of TPS generated by an user. To control number of hits on a application under test.     Types of Pacing: There are three options to control the pacing in a script: General Pacing:    1. As soon

Load distribution on TPS (Transactions per seconds)

We can distribute the total number of users in a script randomly, e.g if there are more than one Action in a script and we want to execute it randomly, we can use the below syntax: =================================================================== int generateRandomTPS; //declaring the variable name generateRandomTPS = rand() % 99;  //Random number between 0 and 100     //This is check if the randomly generated number is between 0 to 49 then run Action1.     if ((generateRandomTPS >= 0) && (generateRandomTPS <=49))          {             Action1();           }   //This is check if the randomly generated number is between 50 to 100 then run Action2.  else if ((generateRandomTPS >= 50) && (generateRandomTPS <=100))         {           Action2();         } Note: It's advisable to create a new action in which you can write the above code.

Parameter file configuration

For running the script in  Controller/Performance Center a lways use data file as unique on each iteration in parameter setting. Generally we select parameter file sequential on each iteration which is not a good practice, this option will force all users to pick the first value of parameter list. e.g: if there are 100 users and we have 100 data in parameter file, when we select sequential on each iteration then all the 100 users will pick the first data and then in second iteration they will take the second data. If the data is unique and can be used by only one user at a time then our script will fail. However when we run the same script in VUgen then it will pass. We can use another method to validate the data in VUgen itself rather than running it in Controller. Use blocks in Run Time setting and keep init and end part in action and run it for 100 iteration. In this case on every iteration it will take the new data from parameter file. But this is not a good practice as eve

Difference between Manual and Goal Oriented Scenario

Manual Scenario: In Manual scenario we define the number of Virtual Users that will hit the application, In this scenario we don't bother about the number of hits or throughput e.g, if we want to check the stability of application on the Vuser load of 500, then we can specify the number of Vusers to 500. Goal Oriented Scenario: In this scenario we decide the goal of execution by setting the number of  Hits/sec,  transactions/sec, Number of  Virtual Users, T ransaction response time and P age per minute.  The scenario will run till it achieves the number of hits or the defined parameter. e.g if we set hits=50, the scenario will run until it reaches hits to 50.

T-Code Naming convention in SAP

The T-Code also called as Transaction Code in SAP has different meaning that depends on the functionality of application and few are customized one according to requirement. There are few standard T-Codes which remains same for most of the applications. example: Standard T-Code: SE16 SM37 Customizes T-Codes like: ZR01 In the above T-Code  SE : System Engineering,  SM : System  Maintenance. The last two numbers assigned in T-Codes are assigned for editing, view, creation, display etc..

How to write data in notepad using Loadrunner script

This code will save the Vendor numbers to a notepad file. (put it in vuserinit starting after Header) //Path for saving the notepad file, the file name is "MatDocument.txt" #define filename "C:\\Documents and Settings\\ravi\\Desktop\\MatDocument.txt" f_Write(char *str1) {          long a;          a = fopen(filename,"a+");          if (a==NULL)           {             return -1;          }          else          {             fprintf(a,"Material Document Number is %s\n",str1);             fclose(a);          } }

Load Runner code for writing data in notepad

Below code is to save the Vendor numbers to a notepad. (put it in vuserinit starting after Header) //Path for saving the notepad file, the file name is "MatDocument.txt" #define filename "C:\\Documents and Settings\\ravi\\Desktop\\MatDocument.txt" f_Write(char *str1) {           long a;           a = fopen(filename,"a+");           if (a==NULL)            {               return -1;           }           else           {               fprintf(a,"Material Document Number is %s\n",str1);               fclose(a);           } }

How to find out Memory Leak in an application?

There are many reasons for memory leak and being a tester its tough to find exact reason. The basic thing we need to understand what is memory leak? How it occurs? Memory leak can be defined as the un-allocated space in a system which was used by a program and after  use it was never returned to the operating system. This un-allocated (unused memory) can cause shortage of memory and may crash the entire system. There are few steps which may help to find out memory leak in  a system: We can monitor the memory graph by using perfmon and check if the memory utilization is keep on increasing and remain at peak even without any load, it shows the memory that was used while executing the program is still in use even the program doesn't needs it. The un-managed code is not efficient enough to release the memory and free it after use, which may cause out of memory issue. You can check the throughput graph while load testing and if there is sudden spike in it then it can be one of th

How do we write a user defined function in LoadRunner?

Create the external library that contains the function. This library must then be added to the bin directory of VuGen. And then, the user-defined function can be assigned as a parameter. -Source-Internet: We need to create an external DLL libraray to use the user defiend function. It can be substitued as paramter values. The syntax is: __declspec(dllexport) char *(char *, char *) Both the arguments passed are NULL for this function. An User-defined function could be : __declspec(dllexport) char *GetSysDate(char *, char *) This would return the system date. You could substitute this returned value for a parameter instead. Once the .dll is declared In LoadRunner script you can directly use this function: lr_load_dll("mydll.dll") Then you can call the functions in the .dll directly: date = GetSysDate(char1, char2) char1 and char2 and the names of variables Note: Within a header file you can also define other user defined functions to be called within the script. This pr

What is JVM Monitoring

It is a Java profiler integrated with Eclipse to monitor CPU, Memory usage and T hreads  of Java applications. JVM Monitor would be useful to quickly inspect Java applications without preparing any launch configuration beforehand. JVM Monitor automatically finds the running JVMs on local host and you can easily start monitoring them. It is also supported to monitor Java applications on remote host by giving hostname and port number.