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 pac...

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))      ...

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...

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);      ...

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);             ...

How to find out Memory Leak in an application?

A memory leak can have many causes, and as a tester it's hard to pin down the exact one. What you can do is spot the symptoms early and hand developers solid evidence. To do that, you first need to understand what a memory leak is and how it happens. What is a memory leak? A memory leak happens when a program takes memory, stops needing it, but never gives it back. The memory stays reserved, so nothing else can use it. Over time the available memory shrinks, which can slow the application down, trigger out-of-memory errors, and in the worst case crash the application or the whole system. How to spot a leak during testing Watch memory over time. Use Windows Performance Monitor (PerfMon) to chart memory usage during the test. If memory keeps climbing under steady load, and stays high after the load stops, the application is holding on to memory it no longer needs. Compare throughput and response time. If they get worse the longer the test runs while memory keeps rising, a...

How do we write a user defined function in LoadRunner?

A user-defined function parameter in LoadRunner gets its value from a function inside an external DLL. It's useful when the built-in parameter types can't produce the value you need, such as a custom date format. You write the function, build it into a DLL, and then use it like any other parameter. How it works Write a function that follows the required format (shown below). Build the function into a DLL. Copy the DLL into the bin folder of your VuGen installation. This is VuGen's default library path, so you only need to enter the DLL name and not a full path. In VuGen, create a parameter and set its type to User Defined Function . Enter the DLL name and the name of your function in the parameter's properties. Required function format __declspec(dllexport) char *functionName(char *, char *) The function must return a string ( char * ) and take two char * arguments. LoadRunner passes NULL for both when it uses the function as a parameter, so your functi...

What is JVM Monitoring

JVM Monitor is an open-source Java profiler that plugs into the Eclipse IDE. It lets you watch the CPU, memory and thread usage of a running Java application without leaving Eclipse. Why use it? JVM Monitor is handy when you want a quick look inside a Java application. You don't need to prepare a launch configuration first. It finds the JVMs running on your machine automatically, so you can start monitoring one in a couple of clicks. It can also monitor an application on another machine if you give it the hostname and port. What it shows View What you see Useful for Timeline Charts of used heap, loaded classes, thread count and CPU usage Spotting trends during a test run Threads All threads, including deadlocked ones and threads using a lot of CPU Finding deadlocks and busy threads Memory A heap histogram with object count and size per class Finding classes that hold the most memory CPU A CPU profiler you configure and run, then analyze call by call Finding wher...