Friday, February 2, 2018

Interview Questions

1.     What are the different scripting issues you faced so far?
Ans) some of the important real times which I have faced are

(a)  When I am recording the loadrunner script , the script has been not recorded then I have checked the Network options changed the capture level from WinNet level data to Socket level data, also added the new entry Server->All, Port->Any and service->Auto detect, SSL->No

(b) Problem) while generating analysis report the transaction summary has numbers instead of transaction names. This issue is seen mostly in case of test being run in performance Center. 

   Solution)Try the following workaround so that Analysis will display names under transaction names rather than numbers in the Analysis Report.

1. Open a new analysis session and change the option there in Tools ---> Options ---> Result collection --->Choose "Generate summary data only."
2. The default is "Display summary while generating complete data." 
3. Then, go to File ---> Open ----> Change the "Type of File" to "LoadRunner Results."  The default is "Analysis Session Files."
4. Choose the .lrr file and Click on "Open". 
5. The Analysis report will be generated.  Save the .lra file.
6. Open the .lra file and check the Summary report for transaction names.

2.     What are the performance bottlenecks that you found in projects you were working? What are the recommendations made to overcome those issues?
Ans) I have found the many bottlenecks in application, some of them are
(a)  I have found the bottleneck in the Javascript request which is taking more response time than SLA (service level agreement) , when I studied deeply into it , the main cause for taking the high response time is the loading of the css file is very heavy to download and redirection is happening while loading the content. (It is fixed by using angular js instead of simple java script)
(b) For logging into application and also which includes database related transactions are very slow, then I have looked into the tables in the database indexing is not present in the tables, once the indexing is attached for the tables then readability of the very fast when compare to previous results.

3.     Have you applied Little’s law in your project? If so, how?
       Ans) Yes, The law states that the average number of customers in a system (over some time interval), N, is equal to their average arrival rate, X, multiplied by their average time in the system, R.
N = X . R
This law is very important to check whether the load testing tool is not a bottleneck.
For Example, in a shop , if there are always 2 customers available at the counter queue , wherein the customers are entering the shop at the rate of 4 per second , then time taken for the customers to leave from the shop can be calculated as
N = X . R
R = 2/4 = 0.5 seconds
A Simple example of how to use this law to know how many virtual users licenses are required:
Web system that has peak user load per hour = 2000 users
Expected Response time per transaction = 4 seconds
The peak page hits/sec = 80 hits/sec
For carrying out Performance tests for the above web system, we need to calculate how many number of Virtual user licenses we need to purchase.
N = X. R
N = 80 . 4 = 320
Therefore 320 virtual user licenses are enough to carry out the Load Test.
Eg: Any website, Login and check the URL. The URL consist of Session Value which is dynamically generated by the Server and even developer cannot tell that "What the dynamic value is going to generated"

4.     What is your approach for analysis?
Ans) Approach for analysis for finding out problems in the application is always depends on the initial baseline test conducted for application.
If the application is not reaching the SLA (ex: 5secs) then issues may be the Front end technologies like java script, css, angular js, html 5…etc code in the methods may consume higher response time due to the bad code.
The Data base tables are not having proper indexing, also the connection pooling for loading the data may very slow, and data loading is very slow due the improper normalization and duplicate records in database.

5.     What do you monitor while execution?
Ans) While execution of the desired scenarios for the application , we always look for both client side metrics like transaction response time, throughput, hits per second , Running Vusers ..Etc and server side metrics too like CPU Utilization, Memory consumption, garbage collector performance …etc

6.     How to extract server data for test execution and how to analyze that?
Ans) Every time post the execution of the tests we need to exact the data from the server which is the CPU ,Memory , Garbage collector , Heap Memory ..etc which may be in graphical representation we need the third party tools like Dynatrace , JavaMelody , Jvisual VM..Etc to get the exact metrics

7.     How to identify performance bottlenecks?
Ans) Identification of the bottlenecks is looking deeply into the code level why was problem causing not to reach particular transaction with in the SLA (service level agreement).
Based on the existing environment need to check the server and client side code, server’s performance, Architectural level components effecting for the performance in current release. Etc

8.     What are the Challenges that you face during scripting?
Ans) Challenges faced on the scripting
1)    Using of the file functions in the scripting of Vugen
2)    Using of the randomization techniques in scripting
3)    Handling the correlation for the .Net and java applications like view state , Even validation , session ids…etc

9.      What is the Correlation function? How do you do that and how do handle the correlation function? What are the challenges in correlation? How do you know that this is correlation issue? How do you identify the correlation value?
Ans) (a) Correlation is a concept where we can capture the dynamic data when it is generated and used throughout the script.
(b) Correlation function can be added by using the predefined function of the loadrunner (web_reg_save_param)
Ex:
//<input type="hidden" name="userSession" value="118094.434831916zAHtticptQVzzzzHDzttzpiQtQf"/>
web_reg_save_param("sessionId","LB=type=\"hidden\" name=\"userSession\" value=\"","RB=\"/>",LAST);
(c ) Challenges in the correlation is  proper capturing the dynamic value with the boundaries and make sure that script should work for any number of users successfully with any number of iterations.
Randomization Technique for correlation function:
To pick up the random occurrence of our dynamic
char *temp;
web_reg_save_param("Random correlation variable","LB=value","RB=value","ORD=ALL",LAST);
temp=lr_paramarr_random("correlation variable");
lr_save_string(temp,"Random_Correlation");
Now we have to substitute this Random_Correlation variable for the place of dynamic value.
(d) Correlation issue is know when we are running the same script for more than once it fails due to change in the response from the server, which is shown in the below screenshot.
(d) correlation value is identified by recording the same flow of the application twice and comparing the both the scripts in side by side, what are the values changing per each recording which is not user input, the values should populate from the server.

10.  How do you handle the error handling in scripting?
Ans) Error handling can be done in the scripting of the loadrunner , to give the user friendly messages to the users and make sure that script which we are running is navigating through the entire application flow according to the work flow.
Example:
web_reg_find("Text=Login","SaveCount=Text1",LAST);
lr_start_transaction("Demo_Login");
web_url(........)
if(atoi(lr_eval_string("{Text1}"))>0) Note: array to integer.
{
lr_end_transaction("Demo_Login",LR_PASS);
}
else
{
lr_end_transaction("Demo_Login",LR_FAIL);
lr_error_message("%s",lr_eval_string("Login is failed for this user {VuserID} Iteration number {Iteration_Number}"));
lr_exit(LR_EXIT_MAIN_ITERATION_AND_CONTINUE,LR_FAIL);       
 }

5 comments :

  1. Thank you very nice blog... keep posting u have

    ReplyDelete
  2. This is very nice blog i have ever seen !!!!!!!!!

    ReplyDelete
  3. Thanks for sharing performance tesitng interview questions and answers. Here are a few links for software testing job seekers,
    Software Testing Job Board
    Performance Testing Jobs

    ReplyDelete