QA And PE

This blog discuss the various topics associated with software testing and software automation using automated tools such as QTP. You are most welcome to share topics related to software testing or comment on any topic below

Thursday, April 16, 2009

LR - web_reg_find Function

Load Runner - 
When you perform load testing, you have to be fully confident, that your application works correctly. It may be very usefull to check UI of application - is it shown correctly or not.

This verification could be done using web_reg_find function

Please, note:
web_reg_find function has been added before the page opening function (web_url)!
This is because LoadRunner web_reg_find function does not search for text on a page, it just registers a search request for a text string on an HTML page.

This is very important and I would like to pay your attention - web_reg_find function should be placed before the function, which loads a page.

Example: 
// Set up check for successful login by looking for "Welcome" 
       web_reg_find("Text=Welcome", "SaveCount=Welcome_Count", LAST); 
// Now log in 
       web_submit_form("login.pl", ...................

// Check result 
       if (atoi(lr_eval_string("{Welcome_Count}")) > 0)
{lr_output_message("Log on successful."); } 
        else
{ lr_error_message("Log on failed"); 
          return(0);    } 
  

Labels:

Tuesday, April 14, 2009

LR - Concurrent And Simultaneous vusers

This is one of the most frequently asked questions from LoadRunner newbies. If we go by the literal meaning from Dictionary.Com both are same but from LoadRunner’s perspective there is a slight difference.

All the vusers in a particular scenario are called Concurrent vusers. They may or may not perform the same tasks. On the other hand simultaneous vusers is more to do with rendezvous points. When we set rendezvous points we instruct the system to wait till a certain no of vusers arrive so that they all can do a particular task simultaneously. These vusers performing the same task at the same time are called Simultaneous vusers.

For example in a Yahoo Mail application: Suppose a scenario consists of 100 vusers with 3 tasks – 1) Login, 2) Check no of unread mails 3) Logout. Vusers at 1) + 2) + 3) will be called as concurrent vusers as they are part of same scenario performing some task but if have set a rendezvous point so that say 25 vuser perform the 2) task at the same time these 25 vusers would be termed as simultaneous vusers.

Labels:

LR - Process and Thread

Process is defined as the virtual address space and the control information necessary for the execution of a program whileThreads are a way for a program to split itself into two or more simultaneously running tasks. In general, a thread is contained inside a process and different threads in the same process share some resources while different processes do not.

Source

In terms of Loadrunner, when we run Vuser as a process, LoadRunner creates 1 process called mmdrv.exe per Vuser. So if we have 10 Vusers, we will have 10 mmdrv.exe processes on our machines.

while when we run Vuser as a thread, LoadRunner creates 1 thread per Vuser. So if we have 10 Vusers, then we will have 1 process with 10 threads running inside it if the limit is 10 threads per process.

Running Vuser as a thread is more memory efficient that running Vuser as a process for obvious reasons that less memory resources are utilized when we run them as thread.

Labels:

LR - Recording Mode

Load Runner - 

There are three types of recording mode/levels in LoadRunner. GUI-based, HTML based and URL based. For the uninitiated, recording levels tells you the amount of and what information is recorded during the recording process. As the title says, for this post we will keep focus on HTML based and URL based recording levels only and will touch upon GUI based mode, in a later post.

URL vs HTML

  1. HTML based mode, records script for every user action that is performed during recording (hmmm…sounds like QTPwhile URL based mode records each and every browser request to the server and resources received from the server. Confused? ok, HTML based mode does recording as you perform clicks and doesn’t give you inside information like what is happening behind the recording whileURL based mode records each and every step and emulate Javascript code.
  2. From the point1) above you can guess, HTML mode would have lesscorrelation to do while URL mode has much more complex correlation requirements.
  3. HTML mode is smaller and is more intuitive to read as the statements are inside the functions corresponding to the user action performed. In the case of URL based, all statements gets recorded into web_url()
  4. HTML mode is recommended for browser applications while URL mode is recommended for non-browser applications.
  5. Lastly, don’t get the impression that I am advocating for HTML mode :). URL mode can be of real help when you want to have control over the resources that need to be or need not to be downloaded, since you have each and every statement in-front of you (point 1)

Labels:

PE - Memory Leaks/ Page Fault

Performance Engineering -  

memory leak is a particular type of unintentional memory consumption by a computer program where the program fails to release memory when no longer needed. This condition is normally the result of a bug in a program that prevents it from freeing up memory that it no longer needs.This term has the potential to be confusing, since memory is not physically lost from the computer. Rather, memory is allocated to a program, and that program subsequently loses the ability to access it due to program logic flaws.

A page fault is an interrupt that occurs when a program requests data that is not currently in real memory. The interrupt triggers the operating system to fetch the data from a virtual memory and load it into RAM.

An invalid page fault or page fault error occurs when the operating system cannot find the data in virtual memory. This usually happens when the virtual memory area, or the table that maps virtual addresses to real addresses, becomes corrupt.

Labels: