Thursday, December 19, 2013

How to Understand LoadRunner Report Web Resource Monitors

Here you get the  information about the performance of your Web server using  Load Runner’s Web Resource monitor.
  • Hits per Second Graph on page 
  • Throughput Graph on page 
  •  HTTP Responses per Second Graph on page 
  • Pages Downloaded per Second Graph on page 
  • Retries per Second Graph on page 
  • Connections Graph on page 
  • Connections per Second Graph on page 
  •  SSLs per Second Graph on page
About Web Resource Monitoring

The Web Resource monitor enables you to analyze the throughput on the web server, the number of hits per second that occurred during the scenario, the number of HTTP responses per second, the HTTP status codes (which indicate the status of HTTP requests, for example, the request was successful, the page was not found) returned from the Web server, the number of downloaded pages per second, the number of server retries per second, the number of open TCP/IP connections, the number of new TCP/IP= connections per second, and the number of SSL Connections per second.

Hits per Second Graph

The Hits Per Second graph shows the number of hits (HTTP requests) to the Web server (y-axis) as a function of the elapsed time in the scenario (x-axis). This graph can display the whole step, or the last 60, 180, 600, or 3600seconds. You can compare this graph to the Transaction Response Time graph to see how the number of hits affects transaction performance.

Throughput Graph

The Throughput graph shows the amount of throughput on the Web server (y-axis) during each second of the scenario run (x-axis). Throughput is measured in bytes and represents the amount of data that the Vusers received from the server at any given second. You can compare this graph to the Transaction Response Time graph to see how the throughput affects transaction performance. In the following example, the Transaction Response time graph is compared with the Throughput graph. It is apparent from the graph that as the
throughput decreases, the transaction response time also decreases. The peak throughput occurred at approximately 1 minute into the step. The highest response time also occurred at this time.

Retries per Second Graph


The Retries Per Second graph shows the number of attempted Web server connections (y-axis) as a function of the elapsed time in the scenario (x-axis). A server connection is retried when the initial connection was unauthorized, when proxy authentication is required, when the initial connection was closed by the server, when the initial connection to the server could not be made, or when the server was initially unable to resolve the load generator’s IP address. 

Connections Graph 

The Connections graph shows the number of open TCP/IP connections (y-axis) at each point in time of the scenario (x-axis). One HTML page may cause the browser to open several connections, when links on the page go to different Web addresses. Two connections are opened for each Web server. This graph is useful in indicating when additional connections are needed.

For example, if the number of connections reaches a plateau, and the transaction response time increases sharply, adding connections would probably cause a dramatic improvement in performance (reduction in the transaction response time)

Connections per Second Graph

The Connections Per Second graph shows the number of new TCP/IP connections (y-axis) opened and the number of connections that are shut down each second of the scenario (x-axis).

This number should be a small fraction of the number of hits per second, because new TCP/IP connections are very expensive in terms of server,router and network resource consumption. Ideally, many HTTP requests should use the same connection, instead of opening a new connection for each request.


SSL connections per second

No of SSL connections opened per second After TCP/IP connection SSL connection is opened. SSL connection has heavy resource consumption. If we select simulate new user at each iteration then there should not be more than one SSL connection per sec

Common Errors with Java Scripts in Controller / Replay

Below are some common issues / errors that are faced while replaying / running java vuser scripts in load runner:

"22994 : Error:Unable to create Java VM"

This error usually means that the PATH and the CLASSPATH environment variables are not set properly.
Delete ini file for Vugen:
a. Shutdown Vugen.
b. Go to "Window install directory" and look for vugen.ini. Delete the file. LoadRunner will recreate new configuration file when VuGen is launched.
c. Launch VuGen and run the script again.

"22997 Java Vuser Compilation failed"


Make sure that LoadRunner and the Java environment are set up properly.

1. Ensure the "jdk install dir"\bin and "LoadRunner Install dir"\bin directories are in the PATH environment variable.

2. Ensure "LoadRunner Install dir"\classes, "LoadRunner Install dir"\classes\srv, and "JDK install dir"\jre\lib\rt.jar are in the CLASSPATH environment variable (preferably at the beginning of the entry).

3. Add any necessary application CLASSPATHs to the environment variable.

4. Remove potentially conflicting entries in both the PATH and CLASSPATH entries (sometimes having the Java environment set up for QTP will conflict with the LoadRunner compilation process).

5. If you are running the script on a remote load generator, make sure that you apply the same update (1-4 ) there, and then, restart the LoadRunner agent.

6. Make sure that any classpaths specified in the Run-Time settings of the script are valid on the load generator machine as well.

"22992 Can't find Actions.class"


Make sure that there is a file named "Actions.class" within the script directory. This is the Java bytecode file generated from compiling Actions.java. If this file does not exits, there could be a compilation problem.

If the file exits, verify the folllowing:
1. Ensure the "JDK Install dir"\bin and "LoadRunner Install dir"\bin directories are in the PATH environment variable.

2. Ensure "LoadRunner Install dir"\classes, "LoadRunner Install dir"\classes\srv, and "JDK Install dir"\jre\lib\rt.jar are in the CLASSPATH environment variable (preferably at the beginning of the entry).

3. Add any necessary application CLASSPATHs to environment variable.

4. Remove potentially conflicting entries in both the PATH and CLASSPATH entries (sometimes having the Java environment set up for QTP will conflict with the LoadRunner compilation process).

5. Make sure to restart the Controller or VuGen in order to have changes in steps 1-4 registered.

6. If the script was working and started to throw the above error for no obvious reasons, try to clean up the initilization files and reregister LoadRunner's DLL. To reregister the DLLs and recreate the configuration files:

a. Make sure all the LoadRunner applications are closed.
b. Go to "LoadRunner Install dir"\bin directory and execute register_vugen.bat.
c. Go to C:\Winnt, back up vugen.ini, then delete the file. LoadRunner will recreate new configuration files when VuGen is launched.

7. The JVM is limited to 56 KB per function. If one or more of the functions within the Actions class is too big, you will get the above error. To resolve this, break the function up into multiple functions.

What is ecommerce? Why testing required for e-commerce application?

Electronic commerce or E-Commerce Application:





Electronic commerce (e-commerce or e-comm), is the buying and selling of products or services over electronic systems such as the Internet and other computer networks.

It provides technologies such as electronic funds transfer, supply chain management, Internet marketing, online transaction processing, inventory management systems, and automated data collection systems.

E-Commerce Software Testing
  • It ensures that every page is tested, e-commerce transactions are validated and application is ready for customer use.
  •  The software’s Functionality, compatibility, security, performance and usability are checked
  • Testing is crucial to e-commerce because e-commerce sites are both business critical and highly visible to their users;
  •  Yet the time pressures in the e-commerce world militate against the thorough testing usually associated with business criticality, so a new approach is needed to enable testing to be integrated into the development process and to ensure that testing does not present a significant time burden. 
  • Rapid Applications Development (RAD), in particular, suggests some promising approaches. Like most new ventures, though, e-commerce must find its own way and establish its own methods.


Growth of E-commerce:

  •  E-commerce continues its double-digit year-over-year growth rate, because sales are shifting away from stores and because online shoppers are less sensitive to adverse economic conditions than the average consumer.
  • 32 million people (66% of all adults) purchased goods or services over the internet in 2011, according to the Office for National Statistics. This was an increase from 62% in 2010.
  •  Despite the continued growth of the channel, online retailers face several challenges to growth: Online stores are broadly perceived as a second choice for shoppers, online retail is becoming increasingly seasonal, and online shoppers rarely admit to browsing, which can drive valuable incremental money during their Web shopping experiences. 
 Key Principles of Effective E-Commerce Testing:

Principle 1.:Testing is a risk management process: Effective testing adopts a strategy that is tailored to the type of application or service being tested, the business value of the application or service, and the risks that would accompany its failure. The detailed planning of the testing and the design of the tests can then is confirmed by the strategy into a business-focused activity that adds real business value and provides some objective assessment of risk at each stage of the development process. Plans should include measures of risk and value and incorporate testing and other quality-related activities that ensure development is properly focused on achieving maximum value with minimum risk.

Principle 2: Know the value of the applications being tested: To manage risk effectively, we must know the business value of success as well as the cost of failure. The business community must be involved in setting values on which the risk assessment can be based and committed to delivering an agreed level of quality

Principle 3: Set clear testing objectives and criteria for successful completion (including test coverage measures): The test programmed must be properly planned, with test scripts giving precise instructions and expected results. Some assessment can be made of how many of the requirements have been tested at any given time. Criteria for successful completion are based on delivering enough business value, testing enough of the requirements to be confident of the most important behavior of the site, and minimizing the risk of a significant failure.

Principle 4: Create an effective test environment. It would be very expensive to create a completely representative test environment for e-commerce, given the variety of platforms and the use of the Internet as a communications medium. Cross-platform testing is, naturally, an important part of testing any multi-platform software application. In the case of e-commerce, the term ‘cross-platform’ must also extend to include ‘cross-browser’. In order to ensure that a site loads and functions properly from all supported platforms, as much stress and load testing as possible should be performed. As an absolute minimum, several people should be able to log into the site and access it concurrently, from a mixture of the browsers and platforms supported. It would, therefore, be beneficial to use automated tools, such as Segue’s Silk Performer or Mercury Interactive Load Runner, for performance/load testing.

Principle 5: Test as early as possible in the development cycle: The earlier faults are detected, the cheaper the cost of rectification. In the case of an e-commerce site, a fault found after shipping will have been detected as a failure of the site by the marketplace, which is potentially as large as the number of Internet users. This has the added complication of loss of interest and possibly the loss of customer loyalty, as well as the immediate cost of fixing the fault. The fact that e-commerce development is rapid and often based on changing requirements makes early testing difficult, but testing strategies have been developed by the RAD community, and these can be mobilized for support.

Principle 6: User Acceptance Testing (UAT): The client or ultimate owner of the e-commerce site should perform field testing and acceptance testing, with involvement from the provider where needed, at the end of the development process. Even if RAD is used with its continuous user testing approach, there are some attributes of an e-commerce site that will not be easy (or even possible, in some cases) to validate in this way. Some form of final testing that can address issues such as performance and security needs to be included as a final confirmation that the site will perform well with typical user interactions. E-commerce users are becoming increasingly intolerant of poor sites, and technical issues related to functionality, performance or reliability have been cited as primary reasons why customers have abandoned sites. Early exposure of users to sites with problems increases the probability that they will find the site unacceptable, even if developers continue to improve the site during beta testing.

Principle 7. Regression testing: Regression testing confirms that changes did not have unintended effects, so this must be a major feature of any e-commerce testing strategy. Web-based applications that reference external links need regular regression testing, even if their functionality does not change, because the environment is changing continuously. Wherever possible, regression testing should be automated, in order to minimize the impact on the test schedule.

Principle 8: Automate as much as possible: This is a risky principle because test automation is fraught with difficulties. The key is to take testing processes sufficiently seriously that you document them and control them so that automation becomes a feasible option – then you select, purchase and install the tools. It will not be quick or cheap – but it might just avoid a very expensive failure.

Principle 9.:Capture test incidents and use them to manage risk at release time: A test incident is any discrepancy between the expected and actual results of a test. Only some test incidents will relate to actual faults; some will be caused by incorrect test scripts, misunderstandings or deliberate changes to system functionality. All incidents found must be recorded via an incident management system (IMS), which can then be used to ascertain what faults are outstanding in the system and what the risks of release might be.

Principle: Manage change properly to avoid undoing all the testing effort. Things change quickly and often in an e-commerce development and management of change can be a bottleneck, but there is little point in testing one version of a software application and then shipping a different version; not only is the testing effort wasted, but the risk is not reduced either. Configuration Management tools, such as PVCS and ClearCase, can help to minimize the overheads of change management, but the discipline is the most important thing.

Why is testing important in the e-commerce Application?

  • The first and primary reason is because e-commerce is, by its very nature, business critical and highly visible to its user’s.
  • Any failure can be immediately expensive in terms of lost revenue and even more expensive in the longer term if disaffected users seek alternative sites.
  •  E-commerce is a massive and growing market place but one which requires large up-front investment to enter successfully.
  •  The history of e-commerce development has been littered with expensive failures, at least some of which could have been avoided by better testing before the site was opened to the general public.
  •  Quality Assurance of the software or application developed
  • Verification and validating the product/application before it goes live in the market to prevent it from intruders and hackers.
  • Defect free and user friendly application.

DIFFERENCE BETWEEN JAR, WAR AND EAR FILES

what is a jar? – java Application archive

A Jar file is an archive of many java class files and its associated metadata and resources. The resources can be text, images, html and so on. The JAR format is useful when trying to download a java application in a single click compared to downloading each resource by its name.

A JAR file can have a manifest file. A manifest file can contain paths to other JARs that need to be in place for the JAR to work properly.

The diagram below shows a hypothetical structure


An enterprise application can have multiple tiers. In JEE world, the tiers can be client, web, app and EIS.

A Java enterprise application is deployed on containers. These containers are of two types :
Web Container ex: Tomcat, Jetty
EJB container. ex: Weblogic

A web container hosts JSP/Servlet API which are more or less a request/response handling. The Web container cannot host EJBs which are based on EJB API. The EJB API provides transaction declaration, method level security etc.

A web container has a web.xml in WEB-INF folder. An EJB container has ejb-jar.xml under META-INF folder. These xmls are called descriptors. These descriptors define the structure of the application. A web-inf does it for a web application and an ejb-jar does it for bean implementation.

A java application thus can be archived to be a -
simple JAR file for local use
A WAR file which can have jar files in it to be hosted on a web container
An EAR file which can have both WAR and JAR inside it to and hosted on a JEE container which support EJB 

Changing the Number of Parameter rows in Vugen parameter file

VuGen by default displays 100 lines in it’s parameter file UI under parameter settings.

To change this value from 100 to any value,

go to Vugen.ini and change MaxVisibleLines= 500(whatever value you want)

Steps:

  1. Go to config folder as C:\Program Files\HP\LoadRunner\config
  2. Open VuGen.ini
  3. Search for MaxVisibleLines
  4. By default it shows MaxVisibleLines=100
  5. Change 100 to desired value like 999 or anything and save the file and close.
  6. now you can see all the data what ever you saved.

Do you want to view only the webpage content that was delivered securely? error in load runner

In IE 7 and earlier, this dialog would cause annoyance to users but generally didn't cause any other significant problems. This was because it was worded in such a way that most users would click on the Yes button and allow non-secure content to be downloaded.

However, the wording in the IE 8 version of this dialog has changed:



Some sites are going to find that their secure pages in IE 8 have the following problems:
Any non-secure HTTP image beacons used for analytics data gathering will often be ignored
The page may not display or even work correctly if it relies on non-secure images, CSS or Javascript


Going to Tools->Internet Options->Security
  • Select the Security tab
  • Click on the Internet zone icon at the top of the tab page
  • Click the Custom Level button
  • In the Miscellaneous section change Display mixed content to Enable
  • Repeat steps 1 – 5 for the Local intranet and Trusted sites zones



In this way we can solve the pop up..!

The default result directory is locked in load runner

Vugen will have a little episode and decide that its default results directory is locked, and you will be presented with an friendly dialog box like the one below.

If you have ever wondered what is going on, it turns out the culprit is mmdrv.exe. This executable is the Multithreaded Driver Command Line application that is used to simulate virtual users, and killing all instances from the task manager will remove any locks on your results directory, and you can go back to normal vugenning.

While most of us don’t mind using multiple directories, it seems that even in Vugen 11, the replay log window will always show the log of the first results directory after playback. This can be very confusing when debugging scripts.

This exe can also be used manually to execute vuser scripts from the command line. This can be handy for environment smoke tests.

Common paths in Loadrunner

you can make changes in index file for Certificate entry:
C:\Program Files\HP\LoadRunner\bin\certs


C:\Program Files\HP\LoadRunner\config

open wlrun7 and you will see all default setting of loadrunner..

AgentMaxThreadsPerDriver ---It is where you can specify number of threads per process(mdrv).

HostConnectTO,HostDisconnectTO etc....

you can make changes and restart Loadrunner.

You can see recent scripts on the path: C:\Program Files\HP\LoadRunner\config

For Error file: C:\..Script-Name\logfile

Execution detail: C:\..Script-Name\output.txt

C:\..Script-Name\data\
Recordinglog
CorrelationLog
codeGenerationLog
also..downloaded image will be saved under data

 Result Set: C:\..Script-Name\Result
 Recorded Script: C:\..saved-Script-Name\
e.g script name is dataEntry.usr.
can be launched script by clicking on it.

Connectivity Issue between LGs and PC during Citrix scripts execution in load runner

Some times Connectivity Issue will occur between Load Generator and Performance center During Execution of Citrix scripts.

Solution:

Uninstalled the previous software and Install the Latest software and Patch.HP Load Generator 11.00 Patch 4 suggested by HP.



Apart from patches need to install below listed software on Load generators.
§ .NET Framework 3.5 SP1.

§ Microsoft Data Access Components (MDAC) 2.8 SP1 (or later).
§ Microsoft Windows Installer 3.1.
§ Microsoft Core XML Services (MSXML) 6.0.
§ Microsoft Visual C++ 2005 SP1 Redistributable Package (x86).
§ Microsoft Visual C++ 2008 Redistributable Package (x86).
§ Web Services Enhancements (WSE) 2.0 SP3 for Microsoft .NET Redistributable Runtime MSI.
§ Web Services Enhancements (WSE) 3.0 for Microsoft .NET Redistributable Runtime MSI.
§ Strawberry Perl 5.10.1.
The entire software version should be same like controller version
1) Citrix presentation server client
2) HP software Agent for citrix server
3) HP Update (Latest Patch suggested by HP).
4) HP Load Generator Screen resolution on Load Generators:





Same Resolution should be for during recording.

How to make Load Generator Operational in Performance center

During execution in Performance Centre observed some of the Load Generator has become Non Operational due to this faced connectivity Issue.




Solution:

Making Load generators operational
The LGs becoming non-operational can be made operational using the following steps:




After opening the task manager in the particular Load Generator
a) Restart the Processes:
1) Agentservices.exe
2) Magentservice.exe
b) Goto start > agent configuration > enable firewall Agent and click on “ok” Button.



c) In firewall settings make sure that your MI Listener name should be there and Machine Name should be same as in PC.





d) after that go to in performance centre>Hosts and select particular Load generator host and click on reconfigure host icon.

"An unsigned application from the location below is requesting permission to run Location:127.0.0.1:1080" in load runner

while recording some applications in load runner we may get the following error

 "An unsigned application from the location below is requesting permission to run  Location:127.0.0.1:1080" 



Solution:

 The popup is coming from Java side due to outdated JRE installed on the machine. Updating the JRE/JDK on your machine can resolve this problem. As for LoadRunner is concerned, the warning message shouldn't be a problem.You can accept it and click run it will follow the recording.