Most Commonly asked LoadRunner and Performance testing Interview Questions.
General Guidelines: Most of the interviewers like the answers with example from your projects. For example, if they ask “What is Parameterization”.Instead of giving the formal definition, it will be better, if you take an example from your last project and explain clearly where and how you have used this concept.
1.Problem Statement: Mark the transaction as pass if it is less than certain time; Let’s say 3 secs?
For accomplishing this problem statement, we have to use LR function “lr_get_transaction_duration”. This function captures the response time of that particular request and stores the value in a double.
Code snippet for above
double Res_Time;
lr_start_transaction(“LAUNCH”);
web_url(“index.htm”,
“URL=http://127.0.0.1:1080/WebTours/index.htm“,
“TargetFrame=”,
“Resource=0“,
“RecContentType=text/html“,
“Referer=”,
“Snapshot=t1.inf“,
“Mode=HTML“,
LAST);
Res_Time = lr_get_transaction_duration(“LAUNCH”);
if (Res_Time < 2)
{
lr_end_transaction(“LAUNCH”, LR_AUTO);
}
else
{
lr_end_transaction(“LAUNCH”, LR_FAIL);
}
2.Do we need to enable any setting for Text checkpoint and Image checkpoint to work?
Yes… One needs to enable “Image and Text Checkpoints” in Run-time Settings –> Internet Protocol –> Preferences. By Default this settings is disabled.
3.What is the difference between Correlation and Parameterization?
Correlation | Parameterization |
Used for handling the dynamic values in the script | Hard Coded values will be replaced by a parameter so that the values can change from one iteration to other or from one user to other. |
Dynamic values generated by the server is captured by the LR parameter which will be used at the later part of the script | Lr parameter receives the values from the predefined output source (may be text file or excel file) |
Script fails if these dynamic values are not handled via correlation | Your test will not simulate real-time scenario without paramterization |
Even though, there are many differences but they have one similarity. Both the concepts use LR Parameter
LoadRunner | Jmeter |
Paid Tool but however community edition is available for 50 virtual users for training purposes | Open Source Tool |
LoadRunner supports handful of protocols like HTTP/ HTML, Web Services, PeopleSoft, SAP, Mobile, Native Apps, .Net, Citrix and many more | Jmeter supports only below protocols
|
Owned by MicroFocus | Owned by Apache |
LoadRunner | Performance Center |
Windows Based tool | Web based tool |
Good for small teams | Good for big teams |
Vusers cannot be shared across multiple teams | Vusers can be shared across multiple teams |
7)What is Work-load Modeling?
Work Load Modeling is popularly known as WLM among Performance testers. WLM is used to calculate the pacing for a particular script against the popular belief that it is used for calculating the number of users.
Yes, it can used to calculate the users but for that we need to consider pacing as either zero or some random number. Ideally, Number be users should be given by the client as part of your NFR.
Well, little’s law is used to do WLM.
Below is the little law..
N = X * (Rt + Zt)
- N = No. of Concurrent Users
- X = Throughput (TPS)
- Rt = Response time (Secs)
- Zt = Think Time
- Industry standard for Zt is 10 secs
- Rt + Zt can be considered as Script Execution Time
However, minor modification of Little’s law is used for calculation of pacing
N = X * (Rt + Zt + Pacing)
8)What are the scripting standards that you have used?
- Make sure Author name, Script Name, Recording mode, Script Description is provided at the start of the script.
- Every single parameter name and variable name should follow naming standards that is defined by the organization.
- Every single piece of code should have appropriate comments
- Transaction name should follow naming standards
- Error handling should be done where ever possible
9)What kind of scripting challenges you have faced in your project?
Scripting Challenges while recording: Refer to this link from MicroFocus and look thru all the Problems from 1 to 5.
Scripting Challenges while Replaying: Major issues while playing back will be related to correlation. Identifying the correct values to correlate will be biggest challenge. If not identified correctly, your scripts will fail.
Other than above there will be many more challenges. I will share one such incident. Inspite of trying all possible options, script didn’t record. So, I had to record the web traffic using a tool called fiddler. Then I had to import this fiddler script into vugen and convert it into Vugen script.
10) What kind of challenges you have faced in controller?
Test Data: Most of the issues that you face in controller will be related to test data. Transactions will fail because of following
a) Bad data or incorrect data
b) Data provided is not enough
c) Using the setting like UNIQUE
LG’s:
a)Before start of the test, required LG’s needs to be connected and status of each LG should be “Ready”. Else, execution fails
b)If you are trying to get more users than the LG’s can support, then response times of the transactions will be effected.
Issues with scripts:
Typically multiple scripts will be executed together as part of scenario in the controller. Let’s say , you are running the test with 40 scripts. Even if there is an issue with one script, whole test needs to be stopped, identify the issue with the script and rerun again.
Sometimes, correlation issues will not be identified when run from VuGen. Especially, when you don’t test it with multiple data. These kind of issues will surface when running from the controller.
11)How to create LoadRunner script from HAR file (of Developer tools or Http Watch or fiddler)?
12)what is your approach if the controller got crashed before collating the results?
13) Does Analysis summary report capture the thinktime which is placed inside the trx ?
16)Does Transaction response times include failed transactions?
17) How to modify a request in Fiddler?
18) How to use LoadRunner script for RestFul Web Service?
19) What is String tokenizers and how to use them in Vugen? How to use strtok function?
20) Can we Execute scripts with different protocols at once in Controller?
21) Which Values to Correlate from the Design Studio?
22) Diff b/w web_reg_save_param_ex and web_reg_save_param?
23) What is web_reg_save_param – LB and RB – Loadrunner?
24) What is Text checkpoint & Image Check point?
25) What is Ordinal value and web_reg_save_param in correlation ?
26) HTML Based script Vs URL Based Script
27)How to enable Extended log in Vugen – Not from RTS (Run-Time Setting)?
28) What are the Creating Functions in VuGen?
29) What is the Difference between Lr_exit and Lr_abort (LR EXIT VS LR_ABORT)?
30)In Parameterization What is the Difference between each occurrence and each iteration?
31)What is the Difference between Web submit form VS web submit data?
32) How to Generate Random String in LoadRunner?
33) How to call Functions from VuGen Script?
34)How to execute different / same scripts in different browsers in Loadrunner?
35)How to convert test scenario from percentage mode to Vuser mode?
36)How to handle .js file in loadrunner / VUGEN
37)Difference between Web Server and App Server
38)Calculate Virtual User footprint/How do you calculate the number of LG’s reqrd?
39)DT Telugu Video Day 1
40) DT Telugu Video Day 2
41) Bottleneck For DotNet Application – Discussion – Telugu
42)Adding Vusers wile running the Load test in LoadRunner
43)What is Performance testing?
Performance testing is evaluating the system performance under virtual user load.
44)What are the different types of performance testing?
Performance testing can be of different types like:
- Load Testing
- Endurance/Soak/Duration Testing
- Scalability Testing
- Volume Testing
- Stress Testing
- Failover testing
45) What is a Server?
46) What is a protocol?
47) Difference between load test and stress test?
Load testing is all about testing the application performance under expected load
Stress testing is all about testing the system beyond its capacity to identify the break point of the system.
48) What is the important information to be gathered from application team or client or BA before you start working on any project?
Below are some of the important questions to be asked before you start working on any project.
- What are critical business Scenarios to be tested?
- What are Target Volumes (Users and iterations or Transactions per hour)
- What are the expected average response times or SLA?
- What are the types of tests to be executed like load, soak etc.
- Which Protocol or communication mechanism they implemented for the application?
- Request to provide Application Architecture
- Detailed information about Servers’ configurations
- Is there any Test data dependency?
- Is Performance Testing environment a replica of Production environment?
- What are the testing timelines?
- Is there any proxy dependency?
- Is the load balanced?
49) How do you gather information regarding target volumes to be achieved if your client doesn’t know anything about performance testing?
To answer the above question, we may need to explain 3 scenarios:
Scenario 1:
If the application is already in production:
If the application is already in production, then we should get the historical data (may be for last 6 months or 1 year) by using data analytical tools like Splunk, SQL etc and analyze the data.
For ex: in the last 1-year, which month, which date and which hour was the application most busy. Ie, when was the last time that more number of users accessed the application, how many page views? Etc.
Scenario 2:
If application is NOT in production and also client doesn’t know anything about performance testing.
Because the application is NOT in production, we may have to get the competitor statistics by using some network traffic utilities like alexa.com and analyze page views, locations from which they are accessing the application, etc.
Scenario 3:
If application is NOT in production and also client doesn’t know anything about performance testing and No Competitor in the market
Because there is no competitor in the market, it is very tough to gather data.
Best solution will be to discuss with Client or product owner or BA to understand the core business and get some initial data based on assumptions.
For ex: Let’s say application is related to food delivery and there is no competitor.
Understanding core business means getting some initial information on how many customers are currently buying food at nearby delivery stores and what percentage of customers might shift to online application, what are its peak hours etc.
Possible follow up question:
Have you ever gathered data for scenario 3 mentioned above?
Ans: There was an application for which client didn’t provide any data. However, I have discussed with Business Analyst and application team to finalize the target volumes. (Reaching out to client was not possible directly in our project).
50) Have you worked on test plan document?
Yes, I have updated test plan document for the recent project. It contains some of the important sections to be updated like test objective, Application Architecture,
Business scenarios to be tested, types of testing to be performed, Resources to work on the project, tools to be used for testing, testing timelines, Environment to be tested, Entry Criteria, Exit Criteria, Risks and Assumptions etc.
51) What is Work Load Modelling?
Work Load Modelling (WLM) is a document which consists of information related to what needs to be tested and the approach used to achieve the target. In simple words, we do work load modelling to calculate Pacing.
52) How did you calculate Pacing?
Pacing was calculated using Little’s law formula.
Formula is : N=X*(RT+ZT+Pacing)
Where N= No of users
X= TPS
RT=Response Time
ZT= Think Time
RT+ZT can be called as SET (Script Execution Time)
Note: N and X values are provided by Client
Script execution time is calculated by simply running the developed script in vugen for 2-3 times and taking average elapsed time out of executions.
53) What is thinktime and Pacing?
Think time is a wait time or time gap between two transactions.
Pacing is wait time or time gap between two iterations.
54) What are the protocols that you have worked so far?
Just mention the protocols you worked or have knowledge. For ex: I have worked on 3 protocols so far which includes Web HTTP/HTML, Truclient, Webservices.
55) What is difference between HTML vs URL based recording?
Some of the important differences are as below:
- The number of lines of code generated by HTML mode of recording is less than the number of lines of code generated by URL mode.
- As per above point, Script maintenance is easy with HTML based recorded script. Script maintenance is tough in URL based recording mode.
- HTML mode doesn’t require much correlation efforts when compared with URL based mode.
- HTML mode is related to context-based recording and URL mode is context less recording (every resource will have independent requests generated).
56) Concurrent Users vs Simultaneous Users?
Users who are keeping the load against the application is called Concurrent users.
Users who are performing the same transaction at the same time are called Simultaneous users.
57) What are the different components of Load Runner? Or What is the Load Runner architecture?
Load Runner has following components:
Load Generators: These are highly configured machines which are which are responsible to generate and run vusers to put load on the system.
Vugen: Vugen is a component which is used to develop performance scripts.
Controller/Performance Center: It is used to upload scripts, Schedule run options, assign LG’s and monitor execution results.
Analysis: It helps us to view and compare test results.
Agent process: This component is responsible to communicate between Controller and Load Generator.
58) What is Correlation?
As part of the recorded script, we might have dynamic values which are unique for every run or for every user such as session ID’s or unique ID’s. process of capturing these unique values is called correlation. Below are the frequently used methods:
Web_reg_save_param_ex();
Web_reg_save_param_regexp();
59) What could be the reason for correlation failure?
Generally, we might see below error during correlation function.
Error -26377: No match found for the requested parameter “correlationparameter”. Either the specified boundaries were not found in the response or the matched text is longer than current max html parameter size of 256 bytes. The total length of the response is 48338 bytes. You can use “web_set_max_html_param_len” to increase the max parameter size.
Below are the 4 reason why correlation might fail:
- Invalid LB and RB
- The placement of web_reg_save_param_ex function might be wrong
- Value you are trying to capture might be more than 256 characters
- The actual value itself might not be in the response.
60) Write a correlation function which will capture the entire response.
To capture entire response, we need to give blank value for both LB and RB
For ex: web_reg_save_param_ex(“ParamName=c_param”,”LB=”,”RB=”,LAST);
Note: Entire response might be greater than 256 characters. Hence, You need to write below function at the start of the script which will allocate memory to LR variable.
Web_set_max_html_param_len(“1024”);
61) How do you find LB and RB for a dynamic value?
We can find LB and RB using below options:
- Code generation log
- Snapshot view
- Capture entire response using empty LB and RB and then identify LB and RB
- We can also use view source option in page view.
62) How many ways you can correlate a dynamic value?
- Auto Correlation
- Manual Correlation.
For our scripts we will use manual correlation which is more reliable in long run.
63) What is regular expression and how did you use in correlation?
A regular expression is a sequence of characters that specifies a search pattern in text.
We will use web_reg_save_param_regexp() function to implement regular expression in correlation concept in LR.
For ex: below is the sample data
/*<option value=”Paris”>Paris</option>
<option value=”Portland”>Portland</option>
<option value=”San Francisco”>San Francisco</option>
<option value=”Seattle”>Seattle</option>
<option value=”Sydney”>Sydney</option>
<option value=”Zurich”>Zurich</option>*/
If you want to capture city names then below is the correlation function to be used:
web_reg_save_param_regexp(
“ParamName=c_City“,
“RegExp=<option (value=)\”([A-Z,a-z, ]+)\”>([A-Z,a-z, ]+)</option>”,
“Ordinal=ALL“,
“Group=2“,
LAST);
Another way:
web_reg_save_param_regexp(
“ParamName=c_City“,
“RegExp=<option value=\”(.*)\”>
“Ordinal=ALL“,
“Group=1“,
LAST);
64) How to capture a dynamic value if LB and RB are not present?
If LB and RB aren’t present then we can use previous line static text as LB and next line static text as RB.
65) Can we capture CAPTCHA or OTP values using correlation functions?
NO. We cannot capture Captcha or OTP values using correlation rather you can ask developer to comment that functionality or pass any hard coded value for testing purpose.
66) What are the different checkpoints used in LR?
Text Check point and Image check point are widely used checkpoints in LR.
However, we can even capture response size and response codes and validate.
67) What are the functions used for text check point and image check point?
Web_reg_find(); is a function used to validate text checks.
Web_image_check() is a function used to validate images.
Web_reg_find() must be written before the request and web_image_check() must be written after the request.
Note: option “Enable Image and Text Checks” must be checked in run time settings -> preferences to run web_image_check function.
68) What are the functions to be used to verify download size and response codes?
web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
web_get_int_property(HTTP_INFO_RETURN_CODE);
69) What is the purpose of “SaveCount” arugument in web_reg_find()?
Savecount will save the number of occurrences of the text to be searched in response.
web_reg_find(“Text=Welcome“,”SaveCount=count”,LAST);
web_submit_data(“login.pl”,
“Action=http://localhost:1080/cgi-bin/login.pl“,
“Method=POST“,
“TargetFrame=body“,
“RecContentType=text/html“,
“Referer=http://localhost:1080/cgi-bin/nav.pl?in=home“,
“Snapshot=t9.inf“,
“Mode=HTML“,
ITEMDATA,
“Name=userSession“, “Value={c_userSession}“, ENDITEM,
“Name=username“, “Value={p_userName}“, ENDITEM,
“Name=password“, “Value={p_password}“, ENDITEM,
“Name=login.x“, “Value=55“, ENDITEM,
“Name=login.y“, “Value=5“, ENDITEM,
“Name=JSFormSubmit“, “Value=off“, ENDITEM,
LAST);
Text welcome will be searched in the response of above request and count will be updated with number of occurrences of word welcome in the response.
70) What rendezvous point?
All the users waiting at certain point to hit the request at the same time is called rendezvous point.
lr_rendezvous(); is the function we use to implement.
71) What is Throughput?
The number of transactions produced over time during a test. It is calculated as bytes/sec.
72) What is response time?
The time taken by the system in sending the request and receiving the response
from server is called response time.
73) What is the relation between Response Time and Throughput?
Both are inversely proportional. If Throughput increases then response times should not increase.
74) What is a protocol?
A set of rules or communication mechanism between 2 or more systems.
Most frequently used protocols are WEB HTTP/HTML, WEBSERVICES, TRUCLIENT etc.
75) How do you identify memory leaks/bottlenecks in a system?
We can identify memory bottlenecks in a system by running an endurance test for longer duration like 5hrs, 8hrs, 1day etc. Basically, the RAM will increase and may lead to application crash.
76) What is thinktime and Pacing?
Think time is a wait time or time gap between two transactions.
Pacing is wait time or time gap between two iterations.
77) How do you identify the bottlenecks after running a performance test?
Performance bottlenecks can be identified by analyzing different performance counters such as response times, Throughput, hits per second etc.
78) How do you identify the candidates for correlation and Parameterization?
Values which are changing dynamically every time we run the script needs to be correlated.
Values which are given as input by user while recording the script and have to be run many iterations needs to be parametrized.
79) What is ramp up and ramp down?
The rate at which we increase the load on system by adding virtual users is called ramp down.
The rate at which virtual users exit the system is called ramp down.
80) How many sections are there in Vugen solution explorer?
There are three sections as mentioned below.
- Vuser init
- Action
- Vuser end
Note: We cannot rename or delete the vuser init and vuser end.
81) What is difference between performance testing and performance engineering?
Performance testing is a process where we identify the bottlenecks in the system.
Performance engineering is not only identifying the bottlenecks but also rectifying the problem and taking it to closure.
82) What are the logging options in vugen?
There are 2 types of log options.
- Standard log
- Extended log
Standard log creates a log of functions and messages sent during script execution.
Extended logs create additional logs including warnings, messages, parameterized values etc.
83) What is lr_abort in LR?
It will end the execution if any error occurs. We need to uncheck “continue or error” in Run Time Settings.
84) What is lr_paramarr_random()?
This function is used to pick any random value from correlation parameter and pass it in subsequent requests.
Note: We must use Ordinal=ALL in the correlation function
85) What is lr_exit() function?
It will exit the iteration or action.
Some of the arguments to be passed are:
LR_EXIT_ACTION_AND_CONTINUE
LR_EXIT_ITERATION_AND_CONTINUE
For ex:
web_reg_find(“Text=Welcome“,”SaveCount=count”,LAST);
web_submit_data(“login.pl”,
“Action=http://localhost:1080/cgi-bin/login.pl“,
“Method=POST“,
“TargetFrame=body“,
“RecContentType=text/html“,
“Referer=http://localhost:1080/cgi-bin/nav.pl?in=home“,
“Snapshot=t9.inf“,
“Mode=HTML“,
ITEMDATA,
“Name=userSession“, “Value={c_userSession}“, ENDITEM,
“Name=username“, “Value={p_userName}“, ENDITEM,
“Name=password“, “Value={p_password}“, ENDITEM,
“Name=login.x“, “Value=55“, ENDITEM,
“Name=login.y“, “Value=5“, ENDITEM,
“Name=JSFormSubmit“, “Value=off“, ENDITEM,
LAST);
if(atoi(lr_eval_string(“{count}”))==0)
{
lr_exit();
}
86) What is lr_stop_transaction() and lr_resume_transaction()?
If you want to pause transaction and resume again between start and end transactions then we can use lr_stop_transaction and lr_resume_transaction functions.
87) What is lr_save_string and lr_save_int?
lr_save_string and lr_save_int will assign variable value to LR parameter.
For ex:
Char *str;
Str=”LoadRunner”;
lr_save_string(str,”str”);
int i;
i=10;
lr_save_int(i,”i”);
Note: LR parameter can be any of any name. To avoid confusion, we can give the same name as c language variable as mentioned above.
88) What is lr_eval_string();
lr_eval_string will read the value present in the embedded parameter.
For ex:
Char *str;
Str=”LoadRunner”;
lr_save_string(str,”str”);
lr_output_message(“%s”, lr_eval_string(“{str}”));
output is : LoadRunner
89) What is lr_paramarr_idx()?
Returns the parameter value at a specified location.
For ex: Let’s say there is a correlation parameter which contains all city names.
web_reg_save_param_ex(“ParamName=c_City”,”LB=option value=\””,”RB=\”>”,”Ordinal=ALL”,LAST);
web_url(“Search Flights Button”,
“URL=http://localhost:1080/cgi-bin/welcome.pl?page=search“,
“TargetFrame=body“,
“Resource=0“,
“RecContentType=text/html“,
“Referer=http://localhost:1080/cgi-bin/nav.pl?page=menu&in=home“,
“Snapshot=t10.inf“,
“Mode=HTML“,
LAST);
“c_City” contains all city names like
C_City_1=Frankfurt,
C_City_2= Denver,
C_City_3=London
Task is to find out if London is present in the list or not where we can use lr_paramarr_idx.
icount=0;
cityCount=atoi(lr_eval_string(“{c_City_count}”));
for(i=1;i<=cityCount;i++)
{
strCity=lr_paramarr_idx(“c_City”,i);
if(strcmp(strCity,”London”)==0)
{
icount=1;
break;
}
}
if(icount==1)
{
lr_output_message(“London is found”);
}
else
{
lr_output_message(“London is NOT found”);
}
90) What is lr_continue_on_error()?
When error occurs, Script will continue based on the below options:
lr_continue_on_error(0); No Option
lr_continue_on_error(1); Continue
lr_continue_on_error(2); Skip to Next Action
lr_continue_on_error(3); Skip to next iteration
lr_continue_on_error(4); End user
91) What is web_save_timestamp_param()?
This function will save the timestamp to a parameter. Generates a 13 digit timestamp in milliseconds.
web_save_timestamp_param(“timestamp”,LAST);
lr_output_message(“%s”, lr_eval_string(“{timestamp }”));
92) What is web_set_proxy()?
This function ensures that all requests are redirected to a specific proxy server.
Ex: web_set_proxy(12.25.0.10:443);
443 is default port number for https request
93) What is web_set_user?
If the authentication is required to access the web server, then mostly, we need to use web_set_user function to submit the credentials.
When you record an application vugen will generate a function called web_set_user where credentials need to be passed correctly along with domain name.
web_set_user(“userid”,”password”,”domainabc.com”);
94) What is web_set_certificate_ex();
In order to access the application if any certificate is required then we need to use web_set_certificate_ex() function.
web_set_certificate_ex(
“CertFilePath=cert1.pem”,
“CertFormat=PEM”,
“KeyFilePath=key1.pem”,
“KeyFormat=PEM”,
“Password=abcd”,
LAST );
Note: Certificate file extension should be PEM.
95) What is web_set_socket_option?
Used to set socket level options for the request.
web_set_sockets_option(“SSL_VERSION”, “AUTO”);
Instead of auto, you can use any specific versions as well.
96) How to read and write from file?
//How to read data from the file
//Open The file
//verify if there is any data or not // check if the file is empty or not
// read all the usernames if not empty
//close the file
FileVariable=fopen(FileLocation,”r”);
if(FileVariable!=NULL)
{
//while(!feof(FileVariable))
for(i=1;i<=20;i++)
{
fgets(userNames,100,FileVariable);
lr_output_message(“%s”,userNames);
}
fclose(FileVariable);
}
//How to write data?
FileVariable=fopen(FileLocation,”a”);
fprintf(FileVariable,”%s \n”,lr_eval_string(“{p_userName}”));
fclose(FileVariable);
In globals.h, give the file location path and declare variables.
97) What are the frequent errors observed during load tests?
400 bad requests
404 Page not found
401 Unauthorized error
500 Internal Server error
502 Bad gateway error
504 Gateway Timeout error
503 Service unavailable error
200 Success response
98) What is the reason for heap utilization reaching 100%?
When Garbage collection mechanism don’t work as expected, Heap utilization increases
and may reach 100%. We need to work with development team and analyze heap dumps to find out if there is any memory leakage happened.
99) What is the alternative if you are unable to record script through vugen?
We can use Fiddler or f12 developer tools or Blazemeter.
100) What is the frequent error that you observed when using truclient protocol?
Object identification and synchronization is most important in truclient. Hence, we see object not found issues frequently.
101) What are the metrics that you capture from APM tool?
We have used Appdynamics in our project and below are some of the metrics that we captured.
- Heap utilization
- CPU utilization
- Memory utilization
- Disk I/O
- Slow Methods
- Slow database calls
- Calls per minute
- Errors or Exceptions