In this post, I am gonna discuss performance testing steps with LoadRunner. I won’t say this is an explanation of the Performance Testing Life Cycle (PTLC) because PTLC is a broad topic to discuss which is covered in the other post. You can refer to PTLC topic later on, but for now, you can consider this discussion is a part of PTLC which will move around LoadRunner only.
Basically, there are five major steps which LoadRunner follows. More or less all the performance testing tools; which are available in the market; follow the steps as same as LoadRunner. The way of working could be different but the basic concepts remain the same. Ok; we should not divert from LoadRunner, so let’s come back to LoadRunner. As I mentioned there are five major steps to perform the test using LoadRunner, so they are:
- Script Creation
- Scenario Creation
- Test Execution and Monitoring
- Result Gathering and Analysis
The below figure (Figure 01) shows all the phases of PTLC and their respective tasks. The unmasked tasks have a relation with LoadRunner or you can say that LoadRunner does those tasks. Refer to the figure and understand the fact that where and how LoadRunner basic steps are fitted into PTLC.
1. Script Creation:
LoadRunner has a dedicated component called ‘VuGen’ aka ‘Virtual User Generator’ to record the business flows. VuGen captures the real user’s navigation which he does on the website and then converts it into a code called ‘Script’. VuGen supports ANSI C scripting language which is easy to understand and quick to learn. As you know that ‘C’ is a basic language and is known to most programmers so working on LoadRunner script is a comfortable task. In C language, defining variables and functions, writing some custom code, and applying new logic is not difficult and that gives an easy scripting option in LoadRunner. LoadRunner Script creation has three major parts:
- Protocol Identification: For creating a script you should know the technology/platform of the application on which it is built up. If you do not know then get these details from the application architecture or developer. Previously, VuGen had a feature called ‘Protocol Advisor’ to identify the supportive protocol but Micro Focus had discontinued it. Therefore you need to gather protocol-related information by yourself and choose the correct one.
Sometimes you need to select multiple protocols to record the application which depends on the nature of the application. The list of protocols is available here.
- Script Recording: The recording feature is the biggest advantage of LoadRunner. It supports recording for 90%-95% of protocols and saves the time and effort of a performance tester to write manual code. In some cases, you have to write the custom code but those would be simple logic.
After the selection of the correct protocol, you can start script recording by simply navigating the web pages as per business flow. You can stop the recording once the flow is completed. VuGen takes some time to scan the recording logs and generate the script. Webservices do not follow the recording practice hence the script generation steps are different for them.
- Script Enhancement: LoadRunner generates a very basic script which lacks parametrization, complex correlation etc. Script enhancement is a step to modify the script as per your requirement with the available option in LR and write some custom logic. On the completion of recording, script enhancement makes the VuGen script 100% automated. Script Enhancement has the following steps:
- Insert Transactions (Adding new transaction, if not given at the time of recording)
- Add Rendezvous Points
- Insert Basic Function (like lr_think_time())
- Insert Comments
- Enable Log Messages (if required)
- Insert Synchronization Points (RTE Vusers only)
- Set up the Run-time setting
Some of the steps may be optional for you which you can skip. After the completion of script enhancement work, the script is ready for test execution.
2. Scenario Creation:
A scenario defines what and how to execute the test. A LoadRunner scenario comprises of the script(s), defined workload model, list of machines (Load Generator) and duration of the test. It is the set of business flow in terms of the LoadRunner script which require performance testing as per NFR.
A scenario is created either in ‘Controller’ of LoadRunner or ‘Test Plan’ of Performance Center. While designing the scenario, you set the scenario configuration and scheduling which determines how all the load generators and Vusers behave during the test. To create a scenario you must have proper NFRs (Non-functional requirement) especially the number of users and expected TPS (transaction per second). You need to design the scenario in such a way so that expected figures (User Load and TPS) can be achieved. Sometimes you need to add think time and pacing in the script to achieve the expected numbers.
Refer to the calculators which may help you to create the correct scenario:
3. Test Execution and Monitoring:
In this step, you simply ‘Run’ the created scenario and start to monitor the graphs. You should be confident that the performance test is being executed according to the test scenario and that all the Vusers follow the same business flows which were covered in the scripts. During the test execution, LoadRunner measures and records the transactions of the Vuser script and displays them on the dashboard. LoadRunner provides a wide range of monitoring graphs which show client-side statistics. Response Time, TPS, Running Vuser, Throughput, System’s performance etc. are some of them. Integration of some external monitors like SiteScope also gives an additional benefit of monitoring the server-side stats.
4. Result Gathering and Analysis:
After the completion of the test, the controller gathers and collates the result. The collated result is in the raw format. If you work on the Performance Center and chose the ‘Collate and Analysis’ option then you can get the test result in HTML format as well. You can download these test result files to your local machine.
LoadRunner has a dedicated tool to analyse the result called the ‘Analysis’ tool. The analysis tool provides the facility to read the raw result file; which is generated after the test and displayed in the graphical and tabular format. Analysis tool also has many features that help to perform deep analysis of the available result and find out the actual bottlenecks. You can also apply filters, correlation, merging and overlay options on the graphs and complete your diagnosis of the issues.
Analysis Tool has a variety of report formats. Once the test analysis is completed, you can write a test result summary, bottleneck findings, and bottleneck description, choose the graphs which you want to have in the report and then generate the report in the desired format like .doc, .docx, .pdf, .html etc. Report generation also has a feature to add the logo of the organization, author name, tester name etc. which helps the client or project to know who was involved in the testing.
So, these are 5 basic steps to carry out the performance testing through LoadRunner. This article has a high-level description of all the basic steps of LoadRunner. It does not cover in-depth knowledge. The later part of the tutorial will enlight more information about the same.
You may be interested: