LoadRunner Internal Architecture:
Kli> cpp (C language pre-processor)
Runs can be invoked to run "silently" by invoking Mdrv.exe from a Windows batch script. Mdrv can automatically stop loading Vusers because they communicate with Vusers and monitor CPU usage on Windows Load Generator machines. A separate JVM is instantiated by each Java-based Vuser on Windows-based machines. ![]()
This means the Controller can be started from a DOS batch (.bat) file (preferrably with a short name on a root drive): REM Start Controller: SET M_ROOT=C:\Program Files\HP\LoadRunner\bin cd %M_ROOT% wlrun.exe -TestPath D:\Dev\Dev1.lrs -port 8080 -Run -DontClose pause Press Ctrl-Z to keep this window or
| |
To quickly switch among several applications, save a copy of LoadRunner's ini files after working on it within the Controller, then use Notepad to craft a batch file to copy application-specific versions of ini files before executing wlrun. An example of file copy actions for application XXX: copy %LRDir%/config/wlrun7-XXX.ini %LRDir%/wlrun7.ini copy %LRDir%/config/wlrun7-XXX.dft %LRDir%/wlrun7.dft Prior to v9.0: copy %WinDir%/wlrun7-XXX.ini %WinDir%/wlrun7.ini copy %WinDir%/wlrun7-XXX.dft %WinDir%/wlrun7.dft Some defaults you might want to change:
Values for DefaultScenarioDir, DefaultScriptDir, DefaultResultDir, and [Recent File List] stored in the wlrun5.ini and wlrun7.dft files updated whenever values are changed within the Controller.
VuGen stores and retrieves a vugen.ini file in the Windows folder. When using Java, enable additional debug options: [DynaDlg] JavaLevel=3 When using 8.0 scripts within VuGen 8.1, add to Vugen.ini: [Editor] OLDEDITOR = 1 VuGen opens in LR folder template/qtweb default.cfg and script files. Vu scripts can be coded to use variable values obtained from parameter files external to the script. I have a lot more on VuGen ![]()
I prefer to set Results Settings to "Automatically create a results directory for each scenario execution." which means that LR will increment the name of the Results Name when I start a scenario runs. For example, a value of "Res11" will be automatically incremented to "Res12" or sometimes "Res11-1". Errors are written to the output.mdb MS Access database. See the ASP page I have written to access this database
To prevent errors when processing large result files, use MSDE (Microsoft SQL Desktop Engine). setup SAPWD="StrongPassword" INSTANCENAME="LR" SECURITYMODE=SQL DISABLENETWORKPROTOCOLS=0 /L*v path to log file Using Windows Explorer, share the Data folder. Then in Analysis Options > Database tab, use 8.3 names without spaces (indentified with DOS command DIR /X):
|
What is the difference between a process and a thread?
Process is defined as the virtual address space and the control information necessary for the execution of a program while Threads 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.
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. I read somewhere that running as a process has an advantage that system becomes more stable.
Note that while running Java Virtual User, JVM’s are loaded per process and will follow the same principle above.
What is memory leak?
A 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.
What is a page fault?
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.
*****************************************************************************
*****************************************************************************
HTML vs URL
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.
- HTML based mode, records script for every user action that is performed during recording (hmmm…sounds like QTP) while 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 while URL based mode records each and every step and emulate Javascript code.
- From the point1) above you can guess, HTML mode would have less correlation to do while URL mode has much more complex correlation requirements.
- 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()
- HTML mode is recommended for browser applications while URL mode is recommended for non-browser applications.
- 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)
All about web_url and web_link in LoadRunner
Points to note with web_url and web_link:
- web_url is not a context sensitive function while web_link is a context sensitive function. Context sensitive functions describe your actions in terms of GUI objects (such as windows, lists, and buttons). Check HTML vs URL recording mode.
- If web_url statement occurs before a context sensitive statement like web_link, it should hit the server, otherwise your script will get error’ed out.
- While recording, if you switch between the actions, the first statement recorded in a given action will never be a context sensitive statement.
- The first argument of a web_link, web_url, web_image or in general web_* does not affect the script replay. For example: if your web_link statements were recorded as
web_link("Hi There","Text=Hello, ABC", LAST); | |
Now, when you parameterize/correlate the first argument to
web_link("{Welcome to LearnLoadRunner}", "Text=Hello, ABC", LAST); | |
On executing the above script you won’t find the actual text of the parameter {Welcome to Learn LoadRunner} instead you will find {Welcome to Learn LoadRunner} itself in the execution log. However to show the correlated/parameterized data you can use lr_eval_string to evaluate the parameter.
*****************************************************************************
Few Quick Recording Techniques for Web (HTTP/HTML)
There are situations where recording application using protocol Web (HTTP/HTML) encounters problem such as (1) not recording events, (2) not launching or (3) crashing. The context may deviate however the below list aims to provide a quick resolution to the problems. Obviously, the quick may work/not work in different environment and situations, however it will help you scope down the problem in a sequential and logical manner.
- Use another machine to record
- Use web_custom_request
- Configure Port Mappings using “WinInetlevel data” or “Socket level and WinInet level data”. And if necessary, define the port and certificates.
- Use Older Recording Engine
- Use LoadRunner as Proxy Server on port 7777 for Recording (For Older Recording Engine)
- Determine OS Support Status and application type
- Determine the actual protocol and port number using Winsock protocol or network sniffing tools (WireShark Network Analyzer)
Network Analysis and Sniffing (Point 7)
What Is Network Analysis and Sniffing?
Network analysis (also known as traffic analysis, protocol analysis, sniffing, packet analysis, eavesdropping, and so on) is the process of capturing network traffic and inspecting it closely to determine what is happening on the network. A network analyzer decodes the data packets of common protocols and displays the network traffic in readable format.
A Sniffer is a program that monitors data traveling over a network. Unauthorized sniffers are dangerous to network security because they are difficult to detect and can be inserted almost anywhere, which makes them a favorite weapon of hackers.
A network analyzer can be a standalone hardware device with specialized software, or software that is installed on a desktop or laptop computer. The differences between network analyzers depend on features such as the number of supported protocols it can decode, the user interface, and its graphing and statistical capabilities.
Other differences include inference capabilities (e.g., expert analysis features) and the quality of packet decodes. Although several network analyzers decode the same protocols, some will work better than others for your environment
The Figure below shows the Wireshark Network Analyzer display windows. A typical network analyzer displays captured traffic in three panes:
- Summary: This pane displays a one-line summary of the capture. Fields include the date, time, source address, destination address, and the name and information about the highest-layer protocol.
- Detail: This pane provides all of the details (in a tree-like structure) for each of the layers contained inside the captured packet.
- Data: This pane displays the raw captured data in both hexadecimal and text format.
****************************************************************************
IP Spoofing
Spoofing gives a meaning ‘a composition that imitates or misrepresents somebody's style, usually in a humorous way’. Commenting in a technical way, it can be defined as ‘An attempt to gain access to a system by posing as an authorized user’.
Now, looking at what is IP Spoofing, imitating or masquerading an IP is IP Spoofing.
In computer networking, this term refers to the creation of Internet Protocol (IP) packets with a forged source IP address, with the purpose of concealing the identity of the sender or impersonating another computing system.
What is Load Balancing?
Load balancing is a technique to distribute workload evenly across two or more computers or other resources, in order to get optimal resource utilization, minimize response time, and avoid overload. Using multiple components with load balancing, instead of a single component (one load balancer), may increase reliability.
The load balancing service is usually provided by a dedicated program or hardware device. It is commonly used to mediate internal communications in computer clusters, especially high-availability clusters. If the load is more on a server, then the secondary server takes some load while the other is still processing requests.
Configuring IP Spoofing in Load runner
Internal IP addresses (such as 192.168.1.1) may need to be allocated by the organization's Network Administrator unless you're working in a closed network. The IP Wizard program (from LoadRunner) is used to define multiple IP addresses on each load generator host
- When a host machine is re-started, routing tables are updated with the new addresses. The IP Wizard program creates a batch file (nt_routing.bat for Windows and unix_routing.bat for UNIX machines) and .ips file which updates IP tables
- After turning IP spoofing on (or off), for the setting to take effect, the Load Generator needs to be disconnected and reconnected again.
- To enable multiple IP Addressing,
- At the Load Runner Controller level: Select the menu item Scenario; check "Enable IP Spoofer". Check "Expert mode" on the Tools drop-down menu. This enables "Multiple IP address mode" in the Options dialog ‘General’ tab.
- At Performance Center Level: Open the load test and on the General Tab, check the ‘Enable IP Spoofer’.
*****************************************************************************