LR Material
LR Material
3
2. Load Runner Components:....................................................................................................... 4
3. Load Runner Architecture........................................................................................................ 4
4. Performance Test Life Cycle: ................................................................................................... 5
1. Proof of Concept (POC): ........................................................................................................... 5
2. NFR – Non Functional Requirements ...................................................................................... 6
3. Test Plan ..................................................................................................................................... 7
4. Work Load Model ..................................................................................................................... 8
5. Recording and Enhancements .................................................................................................. 8
Correlation: ................................................................................................................................... 10
Parameterization: ......................................................................................................................... 16
Verification points/checkpoints: .................................................................................................. 22
Advanced Techniques ................................................................................................................... 23
C Data Types: ................................................................................................................................ 23
File operations: .............................................................................................................................. 27
Pre-defined functions:.................................................................................................................... 29
LR Functions: ............................................................................................................................... 29
Web Functions: .............................................................................................................................. 34
Recording Options: ...................................................................................................................... 44
6. Test Data: ................................................................................................................................... 46
Regular Expressions: .................................................................................................................... 48
Fiddler: ............................................................................................................................................ 49
CONTROLLER .......................................................................................................................... 50
IP Spoofing: ................................................................................................................................... 52
Runtime settings: ........................................................................................................................... 54
Pacing Calculations: ...................................................................................................................... 59
Performance Center: ..................................................................................................................... 67
ALM (Application Life Cycle Management) .............................................................................. 69
Types of testing ............................................................................................................................. 70
ANALYZER ................................................................................................................................. 73
Thread Dump: ............................................................................................................................... 80
Memory Dump: ............................................................................................................................... 81
Difference between Load Runner versions:....................................................................................82
Profiling Tools:............................................................................................................................ 80
1. JConsole:............................................................................................................................... 80
2. JVisualVM: ............................................................................................................................... 80
3. JMC(Java Mission Control): ...................................................................................................... 80
Monitoring Tools............................................................................................................................... 80
1. Site scope: ............................................................................................................................... 80
2. Dynatrace: ............................................................................................................................... 80
3. HP Shunra:: ............................................................................................................................... 80
4. Perfmon: ............................................................................................................................... 80
CVS/VSS (Concurrent Versioning System/Visual Source Safe)...................................................80
Bottlenecks............................................................................................................................... 80
COUNTERS............................................................................................................................... 80
Protocols ............................................................................................................................... 80
1. SAP Web Protocol ...................................................................................................................... 80
2. SAP GUI Protocol: ....................................................................................................................... 80
3. Web Services Protocol:............................................................................................................... 80
AWR REPORTS ......................................................................................................................... 80
LOAD RUNNER
1. Introduction:
One of the best automated performance tool. It uses ANSI C as the default programming
language and other languages like JAVA & VB.
Advantages:
It supports all types of protocols (HTTP, FTP and SMTP).
Easy to analyze the results and generating scripts.
Load Runner was invented by Mercury, and acquired by Hewlett – Packard Organization, &
finally acquired by Micro Focus.
Performance Testing:
Performance Testing is a Non-Functional testing performed to evaluate application performance
under some load and stress condition. It is generally measures in terms of speed, scalability &
stability for the user activity.
Speed: Determines whether the application responds quickly.
Scalability: Determines maximum load the software application can handle.
Stability: Determines if the application is stable under varying loads.
There are different types of performance testing. They are
Load Testing
Stress Testing
Endurance Testing
Scalability Testing
2. Controller
It will allowing you to design the scenarios and execute the test with multiple users.
3. Analyzer
It will allow to analyze the statistics and finding out the bottlenecks
4. Load Generator
It generates the load against the application.
5. Agent Process
It will establish the connection between Load Generator & Controller.
Based on the above POC, Client has to understand which tool he supposed to buy, which protocol
bundle he supposed to buy & how many labor hours required to finish this application.
What is your approach to gather NFR, if client doesn’t know anything about performance
testing?
Scenario-1: If Application is already in production
Sol: Get the production log files for 1 year historical data using Site analytical tools (or) splunk
tool & try to identify top 5 usage days from that how many no. of visitors accessing that
application, how many no. of page views are happening, which JSP/ASP pages are mostly
accessed by end users & from which region they are accessing the application.
Based on the visitors you can identify no. of users, based on the page views you can identify no.
of transactions.
Based on the JSP/ASP pages you can identify the CBT’s, based on the IP address we can identify
the location/region &conduct baseline testing to identify the expected response time (or) to
baseline the application.
Note:
Whenever we don’t have (SLA’s: Service Level Agreement) expected response times, we have to
conduct baseline test.
Scenario-2:
Client doesn’t know anything & application not in production.
Solution: Get the competitor statistics and conduct the PT
Sol: Using N/W traffic utilities (Ex: www.alexa.com) get the competitor statistics & identify
NFR’s in terms of peak hours, half peak hours, no. of users, no. of page views from which
location they are accessing the application, which pages mostly access by end users & what are
the expected response times for every page.
Scenario-3:
Client doesn’t know about performance testing & application not in production & we don’t
know have a competitor in market.
Sol: Try to understand the Core Business of the application and convert core business to Online
Business. By converting identify how many no. of users, no. of transactions, CBT’s, from which
region they are accessing the application and conduct the base line test to derive SLA’s.
Below are the questions we asked to BA (Business Analyst):
Q-1: How many no. of customers do have in core business?
Sol: 1.3m customers.
Q-2: How many of them are going to register for online services?
Sol: 10%
Q-3: How many of them are active users?
Sol: 10%
Q-4: How many of them are daily users?
Sol: 30%
Q-5: What are the peak hours for our business?
Sol: 4 hours
Based on above statistics we derived the number of users and number of transactions.
Generic Case Study:
I have an application stake holders & project is not in a situation to provide the requirement. So
we approached Business Analyst (BA: People to finalize the NFR.
3. Test Plan
Sol: Test Plan is a road map of our test,
Test Plan contains objective of the test, scope, items out of scope, procedure, approach, test data,
CBT’s, types of testing, monitoring, application architecture, tool architecture, deliverables, roles
& responsibilities, environment, risks & migrations, entry criteria, exit criteria, prerequisites &
assumption.
Entry Criteria:
Whenever the Pre-requisites are satisfied that is called Entry Criteria.
Exit Criteria:
Whenever derived statistics are meeting expected statistics that can be considered as Exit
Criteria.
Note: Test strategy will describe approach & procedure of the test.
Protocol Adviser:
This option is available from 9.5 version & allow you to choose appropriate protocol for an
application.
Note:
Protocol Adviser never help you to choose the appropriate protocol in realistic environment. We
have to understand the communication mechanism & architecture, we used to contact AD people
to understand which communication mechanism they used in application development. Based on
all these we used to finalize the protocol for an application.
Web Services: It is also one of the famous protocols. If the application uses API’s or web
services or xmls or jsons or restful xmls then we have to use this protocol.
SAP Family: if the application developed in ECC and netviewer and dynapro portal we can use
these protocols.
Citrix ICA: Whenever application published in Citrix environment we have to Citrix ICA
protocol.
Ajax TruClient: If you would like to measure the response times which includes server side and
browser response times (Java script execution)
Correlation is the concept to handle the dynamic values which are generating from server side.
(Or)
Dynamic input to the server. You can conduct the correlation in 2 ways:
1. Auto Correlation.
2. Manual Correlation.
From the above steps, which will create a function & automatically substitute the dynamic value.
Auto correlation process before 11.5 version.
1) Record the script.
2) Replay the script at least once.
3) Click on “Correlate button”.
4) Choose the dynamic value from correlate log.
5) Click on “Correlate button”.
Note:
A design studio or correlation log compares record time response with replay time response dump
the differences into the correlation log or design studio.
2. Manual Correlation
Manually we have to handle the dynamic values. Whatever the steps performed by
autocorrelations steps will be performed manually.
Process:
Step1: How to identify the dynamic values in a script?
Sol: Record the same business scenario twice with 2 sets of data & compare both of them using
“beyond-compare” or “www.text-compare.com” or Tools - “Windiff” (default).
Which values reported differently those values will be considered as dynamic values.
Note:
Which values are not enter through keyboard & which values are chosen from the application,
those values will be considered as dynamic values.
Step2: How to identify the left text & right text for a dynamic value?
Sol: web_reg_save_param(“parameter_name”,”lb=”,”rb=”,LAST);
Copy the dynamic value.
Go to generation log identify first occurrence of the dynamic value.
Copy the left text & right text of the dynamic value.
Step3: Where to write the function?
web_reg_save_param(“parameter_name”,”lb=userSession” value=” ”,”rb=”/>”,LAST);
Sol1: Execute the script in full mode (F4 LOG Extended Log Enable All Options).
Identify the dynamic value based on the left boundary or right boundary in Replay log. Double
click on the same line which will assist you to where to write the function or for which request
the dynamic value was generated.
Sol2: (Not recommendable for web tours) once you identified the dynamic value in
generation log place the cursor on the same line and search for “web_” or “ENDED” then copy
the request and search for the same in script. On top of the same request u can place the function.
NOTE: Generation log contains response and request which never change.
Step4: Substitution
Sol: You can substitute the parameter name where ever the dynamic value is present in script
using control+H.
Whenever you written ORD=ALL your parameter become an Array. It holds all the values with
the name of parameter-1, parameter-2 & parameter-N.
Note:
Variable_count let we know the length of an Array.
2 .Save Length:
Allow you to capture specific no. of characters from dynamic value based on LB and RB.
Ex: savelen=3
By default savelen=”-1”.
3. Save offset:
It will specify the no. of characters it supposed to skip from the dynamic value.
By default saveoffset=”0”.
EX: saveoffset=3 (It skips 3 char)
4. Not found:
By default notfound=”error”.
If the either LB or RB is not present in the response script will through the error like “No match
found for the requested parameter”.
Notfound=”warning”.
If you would like to continue the script execution, even LB or RB is not available in the response
you have to use warning.
5. Search:
It is an optimization technique. Which will instruct the user to search for LB & RB in a specific
location.
By default search=ALL.
Ex: Search= headers: - it will search for LB n RB in only on header
Ex: Search= Body: - it will search for LB n RB in only on body
6. RelframeID:
This is also optimization technique. Specifying to capture the dynamic value from a specific
frame.
Ex: RelframeID=1.2.1
7. Ignore Redirection:
By default ignore redirection= YES
Instructing correlation function to capture dynamic value from a redirected response or not.
8. Convert:
Send Request
Get Response
Again Send Request
HTML - Hyper Text Markup Language
XML - Extensible Markup Language
Environment:
Interview questions
Q1. Why correlation required?
Sol: Whenever you record a use case request make contains some dynamic values. Which are
unique user to user or session to session.
If you are passing the same value in the form of request server won’t accept the same.
To make our script work for multiple iterations we have to capture server generated from current
session pass it into next request. So that your request will be accept by server.
Q2. If the LB or RB is keep on changing. What is your approach to capture the dynamic
value?
Sol-1: If the dynamic LB is static use “Save offset” argument.
Sol-2: Use Flag system.
Any dynamic number is a part of LB we can use Flag System.
Ex-1: H1I Hero Welcome.
H2I Honda Welcome.
Sol: web_reg_save_param(“pavan”,”LB/DIG=H#I”,”RB=Welcome”,LAST);
Ex-2: If you’re LB contains dynamic alpha numeric characters use below solutions:
H1I Hero Welcome
H2I Honda Welcome
H3I Maruthi Welcome
Sol: web_reg_save_param(“pavan”,”LB/ALNUMIC=H^I”,”RB=Welcome”,LAST);
Q3. To capture entire response for a request we have to pass empty LB & empty RB?
Sol: By default LR variable can hold 256 characters. If you decide to capture more than 256
characters. We have to allocate memory to the LR variable.
Ex: web_reg_save_param(“pavan”,”LB=”,”RB=”,LAST);
web_set_max_html_param_len(“1024”);
Note: 1024 is array size in bytes.
Q5. How many ways you can find the LB, RB for a dynamic value?
Sol:
1. Generation log (which never change contains Response & Request).
2. Replay log: We have to execute script in Full mode then only we can identify the LB & RB
dynamic value.
3. Snapshot View or Tree View.
4. Capture entire response using empty LB, empty RB & identify the LB & RB.
5. Using View Source Option in page view.
Q6. My correlation function is keep on failing?
Sol:
1. Invalid LB or RB.
2. Function location might be wrong.
3. May be your trying to capture more than 256 characters.
4. May be the dynamic value itself not available the response.
Q7. What is your approach to capture the dynamic value, if the dynamic value is not
present in the response?
Sol: If the dynamic value is not present in the response speak with developer & try to understand
why & how the dynamic value is generating then get the same functionality (Code) make it as a
external function in VUGen & call the function to generate the dynamic value.
Ex:
OTP – whenever OTP is recorded in your script ask the developer to provide the code which can
generate the OTP.
CAPTCHA – Ask the developer to disable the captcha functionality. Which will allowing to
execute the script with multiple users.
(or)
You can ask to provide a number which can match for any image.
Q9. If the dynamic value is generated by a Java Script file & the same value is not available
in the response?
Sol: Speak with the developer understand how the dynamic value is generating. If it is generated
by Java Script file usually at Client side.
Get the Java Script ( ) create a “.js” file in extra files & call the function whenever you like to
generate the dynamic value.
Q10. If the dynamic value is n’t present in the response or it is a hidden value?
Sol: Use web_add_cookie( ) to pass the dynamic value.
Q11. My first request itself keep on failing. What could be the reason for this?
Sol: Write web_add_header( ) to make it pass.
Parameterization:
Static input to the server or vary input to the server.
Note:
Which values you enter through keyboard those values should be parameterized. Your script
should not contain any hard coded values.
Parameter Types:
1. File
2. Date & Time
3. Iteration Number
4. Random Number
5. Unique Number
6. VUserID
7. Group Name
8. Load Generator Name
9. Table
10. XML
11. User defect
1. File:
Parameter Properties:
1) Sequential Each Iteration
2) Random Each Iteration
3) Unique Each Iteration
4) Sequential Each Occurrence
5) Random Each Occurrence
6) Unique Each Occurrence
7) Sequential Once
8) Random Once
9) Unique Once
10) Same line as some other parameter.
E
2) Random Each Iteration:
F
5) Random Each Occurrence:
7) Sequential Once:
If the user picks any 1 of the data point. We have to continue the same value for all the iterations
& occurrence.
Users Data Point
A
E
8) Random Once:
9) Unique Once:
One to one mapping.
Users Data Point
A
Complex Parameterization:
We can create one “.dat” file with multiple columns for dependent data. Complex
parameterization allow you to handle test data in a proper way.
Current Date:
Where you can choose the current date.
Note:
Data will pick from mission date from where it is executing.
Step1: Right click create parameter & choose Date & Time option.
Step2: Choose or create require parameter in parameter properties & click ok.
Future Date:
You can choose the future date from which mission script is executing.
Step1: Right click create parameter & choose Date & Time option.
Step2: Choose or create require parameter in parameter properties & click ok.
Step3: Choose offset date & provide the no. of dates.
Past Date:
Where you can choose the past date.
Step1: Right click create parameter & choose Date & Time option.
Step2: Choose or create require parameter in parameter properties & click ok.
Step3: Choose offset date & provide the no. of dates.
Step4: We have to choose the prior to current date option.
Note:
Using working days option, we can skip weekends.
3. Random Number:
As per the business scenario we have to generate the random number in specified
boundaries in required format.
4. Unique Number:
We can generate the unique number using unique number parameterization by providing Lower
Boundary & Upper Boundary in required format.
Data Wizard: Will allow you to pull the data from database with the help of connection string
and query.
Simluate parameter: It will give an idea how the user will pick the values based on property in
controller.
By number: Indicating column number from which column user supposed to pull the data.
By name: Indicating from which column user supposed to pull the data based on column name.
Column Delimeter: Values will be separated based on comma (,) or tab or space.
Note: If your data point contains comma, what is your approach to create .dat file?
Solution 1: Create tab or space based dat file instead of comma delimeter.
Solution 2: Keep the comma (,) in double quotes (“”)
First Data line: Indicating the row number from which row user supposed to start picking the
value.
Note: You can load 36000 data points in a script.
When out of values: This option is available for unique-each iteration/each occurrence.
Instructing the user abort the execution or continue in cyclic manner or continue with the last
value when there are no unused data points.
Verification points/checkpoints:
We have to verify whether we received proper response or not using below techniques
1) Text verification points
2) Image verification points
3) Response size
4) HTTP status codes
5) Correlation function (Optional )
Checkpoint function:
web_reg_find(“text=welcome”,”savecount=xyz”,LAST);
After request, we have to write
If (strcmp(lr_eval_string(“{xyz}”),”0”)==0)
{
Lr_output_message(“text check failed”);
}else{
Lr_output_message(“text check passed”);
}
Image verification:
It will verify the response based on image
Syntax: web_image_check(“xyz”,”src=c://image.gif”);
web_image_check is a non-registered function. We have to write after the request to make it
work. You have to enable option “enable text and image verification” in runtime settings.
Web_reg_find Web_find
It’s a registered function It’s a non-registered function
Have to write before the request Have to write after the request
Don’t require to enable any option Have to enable text and image verification in
runtime settings
Current version we are using this function It’s a deprecated function
Advanced Techniques
Note: We are going to use test script language (TSL) in load runner sometimes might require to
write C or Java to make our business scenario work. By default, we will use C language.
Note: We have only one data type in LR that is “string”
Note: We don’t require to declare LR variable.
C Data Types:
Int,
char,
double,
float,
flag,
long,
short,
Boolean etc
Scripting Challenges
Scenario 1:
How to convert an integer value to LR variable?
Solution: “itoa” It converts integer to string
Lr_eval_string It reads the value from a variable
Lr_output_message It displays the message
Example:
Int x=0;
Char abc[100];
Itoa(x,abc,10); //Converting int to string
Lr_save_string(abc,”final”); //Assigning value to lr variable
Lr_output_message(“%s”, lr_eval_string(“{final}”));
Scenario 2:
How to generate random value from an array?
Solution:
Lr_save_string(lr_paramarr_random(“cSource”),”randSource”);
Scenario 3:
How to compare two LR variables?
Solution:
lr_save_string(lr_paramarr_random("c_source"),"Ran_Source");
lr_save_string(lr_paramarr_random("c_desti"),"Ran_Dest");
if(strcmp(lr_eval_string("{Ran_Source}"),lr_eval_string("{Ran_Dest}"))==0)
{
lr_output_message("SOURCE & DESTINATION ARE SAME, CANT BOOK TICKET");
lr_abort();
}
else
{
lr_output_message("SOURCE & DESTINATION ARE NOT SAME, CAN BOOK TICKET");
}
Scenario 4:
How to compare two C variables?
Solution:
lr_save_string(lr_paramarr_random("c_source"),"rand_sorc");
lr_save_string(lr_paramarr_random("c_desti"),"rand_dest");
strcpy(source,lr_eval_string("{rand_sorc}"));
lr_output_message(source);
strcpy(desti,lr_eval_string("{rand_dest}"));
lr_output_message(desti);
if(strcmp(source,desti)==0)
{
lr_output_message("SOURCE & DESTINATIONS ARE SAME, CANT BOOK TICKETS");
}
else
{
lr_output_message("SOURCE& DESTINATIONS ARE NOT SAME, CAN BOOK TICKETS");
}
Scenario 5:
Working for a banking application. Capture the account holder balance and add 10 rs to
balance and substitute in the next request.
Solution:
y = atoi(lr_eval_string("{c_sid}"));
z=x+y;
lr_output_message("%d",z);
itoa(z,final, 10);
lr_output_message(final);
lr_save_string(final,"final_balance");
Scenario 6:
How to use string tokenizer functionality?
Or
How to split a string into multiple strings?
Solution:
char* abc;
char xyz[100];
--------------------RESPONSE BODY--------------------
strcpy(xyz,lr_eval_string("{c_fno}"));
abc=(char*)strtok(xyz,";");
lr_output_message(abc);
lr_save_string(abc,"final");
Scenario 7:
How to split a string into multiple strings?
Solution:
char path[100];
char separators[] = ";";
char* token;
---------------------RESPONSE BODY---------------------
strcpy(path,lr_eval_string("{c_fno}"));
token = (char *)strtok(path, separators); // Get the first token
if (!token)
{
lr_output_message ("No tokens found in string!");
return( -1 );
}
while (token != NULL )
{ // While valid tokens are returned
lr_output_message ("%s", token );
token = (char *)strtok(NULL, separators); // Get the next token
}
File operations
Scenario 8:
How to write a value to a local file?
Solution:
long file;
-------------------------RESPONSE BODY------------------------
file=fopen("D:\\vny_src.txt","a+");
fprintf(file,"SESSION ID : %s\n",lr_eval_string("{c_sid}"));
fclose(file);
Scenario 9:
How to write multiple values/array values into local file?
Or
How to write a for loop?
Solution:
long file;
int i,cnt;
char* temp;
--------------------------RESPONSE BODY-----------------------------
cnt=atoi(lr_eval_string("{c_desti_count}"));
for(i=1;i<=cnt;i++)
{
temp=lr_paramarr_idx("c_desti",i);
lr_save_string(temp,"F_dest");
file=fopen("D:\\vny_dest.txt","a+");
fprintf(file,"SOURCE IS : %s\n",lr_eval_string("{F_dest}"));
fclose(file);
}
Scenario 10
How to generate a random value from an array without using lr_paramarr_random
function?
Or
How to concatenate two lr variables?
Or
How to use atoi and itoa functions?
Solution:
int cnt,x;
char* temp;
char abc[10];
--------------------------RESPONSE BODY-----------------------
cnt=atoi(lr_eval_string("{c_desti_count}"));
x=1+rand()%cnt;
lr_output_message("%d",x);
itoa(x,abc,10);
lr_save_string(abc,"F_dest");
temp=lr_eval_string(lr_eval_string("{c_desti_{F_dest}}"));
lr_save_string(temp,"final");
Scenario 11
Working for a banking application. Capture the account holder balance and add 10.25 rs to
balance and substitute in the next request.
Solution:
float x=10.75,y,z;
char final[100];
------------------------RESPONSE BODY--------------------
y = atof(lr_eval_string("{c_sid}"));
lr_output_message("%.2f",y);
z=x+y;
lr_output_message("%.2f",z);
sprintf(final,"%.2f",z);
lr_output_message(final);
lr_save_string(final,"final_balance");
Scenario 12
How to download a pdf/doc/xls from an application?
Or
How to use VuserID and iteration number parameter?
Or
How to generate time stamp in milli seconds?
Or
How to create a buffered variable?
Or
How to create unique file naming convention?
Solution:
long file;
unsigned long paramlen;
char* newparam;
web_save_timestamp_param(“tstamp”,LAST);
file=fopen(lr_eval_string(“D:\\anand_{puser_id}_{p_iteration}_{tstamp}.pdf”),”wb”);
lr_eval_string_ext(“{vinay}”,strlen(“{vinay}”),&newparam,¶mlen,0,0,-1);
fwrite(newparam,paramlen,1,file);
fclose(file);
Pre-defined functions
LR Functions:
LR functions you can use across the protocols.
1) lr_abort();
This function use for script abort purpose .
example:
if (strcmp(lr_eval_string("{ramana}"), "0") == 0)
{
lr_output_message("Login Failed");
lr_abort();
}
else
{
lr_output_message("Login PASSED");
}
2) lr_exit():
Exits the iteraion or action.
Arguments:
LR_EXIT_USER
LR_EXIT_ACTION_AND_CONTINUE
LR_EXIT_MAIN_ITERATION_AND_CONTINUE
LR_EXIT_ITERATION_AND_CONTINUE
LR_EXIT_VUSER_AFTER_ITERATION
Example:
if (strcmp(lr_eval_string("{ramana}"), "0") == 0)
{
lr_output_message("Login Failed");
lr_exit(LR_EXIT_MAIN_ITERATION_AND_CONTINUE, LR_FAIL); // here v can change the
above arguments.......
}
else
{
lr_output_message("Login PASSED");
}
6) lr_save_string():
It assigns a value to LR variable
Ex: lr_save_string("abc","xyz");
7) lr_save_int():
It assigns integer value in to LR variable.
this also used instead of itoa function.
lr_save_int(x, "xyz"); // here X is a integer
8) lr_eval_string():
It evaluate the value after embedding parameter or it reads the value.
9) lr_paramarr_random():
It generates the random value from an array.
lr_paramarr_random("source");
10) lr_paramarr_idx():
Returns the value of the parameter at a specified location
lr_paramarr_idx("source",10); // it reads 10 th value of source.
11) lr_save_datetime():
Assigns the current date and time to a parameter.
Ex:
lr_save_datetime("%m/%d/%Y %H:%M", DATE_NOW, "currDateTime"); // This statement
write in output message area(after the request)
12) lr_set_debug_message():
Changes the message level for a request
Syntax:
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG |
LR_MSG_CLASS_FULL_TRACE, LR_SWITCH_ON );
web_url()
---
----
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG |
LR_MSG_CLASS_FULL_TRACE, LR_SWITCH_OFF );
Note: Here we need to set standard mode in Runtime Settings.
13) lr_db_connect():
It connects to database with the help of connection statements
14) lr_db_disconnect():
It disconnects from the database
15) lr_db_executeSQLstatements():
Submits SQL statements to database
16) lr_continue_on_error():
On error, scripts use one of these options for continuation:
Syntax:
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
17) lr_load_dll():
The lr_load_dll function loads a DLL (Windows) or shared object (Linux) allowing you to call an
external function when replaying using the C interpreter.
Once you load the DLL, you can call any function defined in the DLL, without having to declare
it. You can specify a full path for the DLL.
Syntax:
lr_load_dll("user32.dll");
18) lr_out_message():
It's sends a message to log file,output windows and summary report
19) lr_log_message():
Sends a message to logfile to the application management agent logfile (or) vuser log.
20) lr_message():
Sends a message to the log and o/p window.
21) lr_error_message():
Sends an error message with location details to the output windows, log files, and other test report
summaries.
22) lr_get_vuser_ip():
Returns the ip address of the user
Syntax:
char* ip;
Ip= lr_get_vuser_ip();
23) lr_get_host_name():
Returns the name of the host
Syntax:
char* name;
Ip= lr_get_host_name();
24) lr_get_master_host_name():
Retrieve the controller machine name
25) lr_whoami():
Returns the information about vuser
26) lr_vuser_status_message():
Sends a message to vuser status area in controller
27) lr_save_searched_string():
It will captures substring from a main string
Syntax:
ex: for flight number 300;365;05/08/2016
char abc[100];
//this code write after the request
no option
strcpy(abc,lr_eval_string("{outboundFlight}"));
lr_save_searched_string(abc, strlen(abc),
1,";", //Searched for 2nd occurrence of “;”
0, //Indicates no skip after “;”
3, //Captures next 3 characters
"year"); // here year is final value (or )abc saved in year
Web Functions
These functions we can use only in web protocol
GET POST
1. Not a secured request 1. It’s a secured request
2. It will send small amount of information to 2. Sends large amout of information
server
3. It can be available in history, cached and 3. It can’t be available in history, cached and
bookmarks. bookmarks.
4. To retrieve the information 4. To submit the data to server
1) web_url():
To launch the application or load the specified URL.
2) web_set_max_html_param_length():
Sets the maximum length of any html string that can be retrieve and stored in a variable.
Syntax: web_set_max_html_param_length(“1024”);
3) web_save_timestamp_param():
Save the timestamp to a parameter. It generates a timestamp in milliseconds which is a 13 digit
number.
Syntax: web_save_timestamp_param(“tstamp”,LAST);
lr_output_message(“%s”, lr_eval_string(“{tstamp}”));
4) web_reg_save_param():
Allow you to capture dynamic value from response.
5) web_reg_save_param_ex():
Allow you to capture dynamic value which is introduced from 11.0 version. It has different
parameters.
web_reg_save_param web_reg_save_param_ex
1. Parameter name 1. Parameter name = xyz
2. Before ORD = 1 2. Now ORDINAL = 1
3. Before search = header/body 3. Now scope = body
4. RelframeID = 1.2.1 4. RequestURL = URL
5. They added content type, data execution
format (def) arguments
6. They deprecated convert argument
6) web_reg_find():
For text verification purpose.
Syntax: web_reg_find("Text=Welcome","SaveCount=Welcome_Count", LAST );
7) web_find():
Text verification purpose. It is deprecated.
8) web_image_check():
Image verification purpose.
Syntax: web_image_check("Text=Welcome", "src=D:\\xyz.gif", LAST );
9) web_set_proxy():
Specifies that all requests should be redirected to a specific proxy server.
Syntax: web_set_proxy(10.10.10.10:8080);
Note: Default port number of https request 443
Default port number of http request 8080
10) web_submit_data():
It is an unconditional context less request which will submit data in form of item data.
11) web_submit_form():
It submits the form and context based request. Submit data in the form of item data.
Note: Context based means request will be dependent on previous response.
Note: Usually we are using web_submit_data option to record scenario.
12) web_get_int_property():
Using this function, you can verify response whether it is proper or not based on HTTP status
codes and download size
Syntax:
int HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
lr_output_message(“%d”, HttpRetCode);
if(HttpRetCode == 200){
lr_log_message(“Script passed”);
}else{
lr_log_message(“Script failed”);
lr_abort();}
13) web_set_user():
For all NTLM (Native Windows Authentication) Applications, we should submit the credentials
against web_server.
Syntax:
web_set_user(“CA:\\Jojo”,”Bean”, HTTP://webtours.kword.com:80);
14) web_set_certificate():
Causes a script to use a specific certificate that is listed in internet explorer registry
Syntax: web_set_certificate (“2”);
Extension: .prm/.cer/.pem
15) web_set_socket_option():
Setting the socket level option for a request
Syntax:
web_set_socket_option(“SSL_VERSION”, “TSL1.1”);
Instead of using above function, you can execute the script using wininet engine but which is not
preferable.
18) web_add_header():
Scenario 1: My first/any request keep on failing even after conducting correlation and
parameterization
Solution: Write web_add_header() function on top of request.
Step 1: Verify correlation and parameterization.
Step 2: Verify whether the page is opening manually or not. If it is opening, then problem is with
header.
Step 3: Verify whether we need to add any SSL.
19) web_custom_request():
It will submit the data in the form of body.
Scenario 1: Based on my previous input, number of fields are changing in current page.
Scenario 2: When I am accessing application in morning, it reported 10 records. In the evening
15 records, next day 20 records. How to make it work for anytime?
Scenario 3: How to write web_custom_request()
Scenario 4: Client asked me to book random number of tickets for every user but based on
random number, number of passenger fields are changing in payment page. How to make my
script work for vary number of passengers?
Sol:
int xyz;
char abc[100], lmn[100];
xyz=atoi(lr_eval_string(“{prandpass}”);
for(i=1;i<=xyz;i++)
{ sprint(abc,”pass%d=”, i); //pass1=
strcat(abc,lr_eval_string(“{ppass}”)); //pass1=anand
strcat(abc,”&”); //pass1=anand&
strcat(lmn,abc); }
lr_save_string(lmn,”r_no_pass”);
1) strcpy()
Copies one string to another
Syntax:
Char hi[10];
Strcpy(hi,”747”);
2) strcmp()
Compares two strings
Syntax:
Strcmp(hi,rao);
3) strcat()
Concatenates two strings
Syntax:
Strcat(abc,”&”);
4) strlen()
Returns length of the string
Syntax:
Strlen(abc);
5) strstr()
Captures substring from main string
6) strtok()
Tokenize the string based on delimeter
Syntax:
xyz = (char*) strtok(abc,”;”);
7) strncpy()
Copies n number of characters to another
8) sprint()
Writes a formatted output to a string
1) fopen()
Opens a new/existing file
2) fwrite()
Writes an unformatted data to file
3) fprintf()
Prints a formatted value to a file
4) fread()
To read the data from a file
5) fclose()
Closes the file
User Defined Functions
Function: Set of reusable statements is called function which has to return something.
Syntax:
vuser_init()
{
Return 0;
}
Note: Dividing you script statements into multiple functions is called modular approach
if (strcmp(lr_eval_string(“{xyz}”),”0”)==0)
{
lr_output_message(“text check failed”);
lr_end_transaction(lr_eval_string(“login_{puser}”),last);
login();
}
else
{
lr_output_message(“text check passed”);
lr_end_transaction(lr_eval_string(“login_{puser}”),last);
}
Scenario 1:
In one of my business scenario, user has to login to application once and has to perform
business scenario 10 times, then logoff from application
Sol:
To achieve above scenario:
Record:
Login procedure into vuser_init()
Business procedures into action().
Logoff procedure into vuser_end().
Scenario 2:
User has to login to application, book and cancel tickets for multiple times. Every iteration
has to perform login and logoff
Sol:
Everything has to be recorded into action().
Scenario 3:
How to create multiple actions?
Sol 1:
While recording itself we can create multiple actions.
Sol 2:
We can create new action using create new action option.
Note: If the actions are not calling from run logic, those will be faded out.
Scenario 4:
In one of my scenarios, have to book tickets for 10 times and cacnel the ticket for 5 times
Or
Have to approve the loan 100 times and cancel the loan 40 times
By creating blocks in the runlogic,
we can achieve the above scenario
Step 1: Go to run logic.
Step 2: Create insert block.
Step 3: Insert actions into block.
Sol 1:
Create two blocks. Insert book action into 1st block, cancel action into 2nd block. Provide block
level iteration.
Sol 2:
Using for loop also, you can achieve above scenario
Scenario 5:
In one of my loan application, 70% loan has to be approved. 30% loan has to be rejected
irrespective of the number of iterations.
Sol:
To achieve above scenario, I will insert both of the actions into one block and provide the % by
choosing random property.
Note: Script extension is .usr
Default script folder contains below files:
Data folder, vuser_init, action, end notepad, global.h, default.cfg, default.usp files, breakpoints
file, custom_body_variables, ReplaySummaryReport, .usr file
Scenario 6:
Scrubbing method for multiple users?
or
I have received 10000 users some of them are not working. How to segregate which are
working, which are not working?
We need to do parameterization for user name and password
long file;
long file1;
web_reg_find("Text=Welcome","Savecount=ramana",LAST);
web_submit_data("login.pl",
if (strcmp(lr_eval_string("{ramana}"),"0")==0)
{
lr_output_message("Text check failed");
file= fopen("E:\\invalid.txt","a+");
fprintf(file,"invalid:%s\n",lr_eval_string("{pUser}"));
fclose(file);
lr_exit(LR_EXIT_ITERATION_AND_CONTINUE,LR_FAIL);// SCRIPT FAILED MESSAGE
WILL DISPLAYED, BUT SCRIPT PASSED FOR OTHER ITERATIONS.
}
else{
lr_output_message("text check passed");
file1= fopen("E:valid.txt","a+");
fprintf(file1,"valid:%s\n",lr_eval_string("{pUser}"));
fclose(file1);
}
Recording Options
Shortcut (Ctrl + F7)
1. Recording:
We do have two modes in HTTP/HTML protocol
1) HTML Mode
2) URL Mode
HTML Mode: Generates a separate step for every user action even you can record non HTML
resouces.
HTML Advanced: Using advanced techniques, you can record web_submit_form or
web_submit_data/
Usually we will use web_submit_data along with record within script.
Advantages:
Easy to understand the script.
Easy to maintain the script.
Very less number of lines of code.
Generate script for HTML and non HTML resources.
Script never fails for non HTML resources. If any one of non HTML resource is not
available, it will throw a warning like resource unavailable HTTP status code 403.
URL Mode: Records not only user actions, even it records server side resources too. It will
generate web_custom_request and web_url.
You can find huge number of lines of code.
It’s very difficult to maintain the script.
It will record non HTML resources in the form of concurrent groups.
URL mode prefers for non-browser specific applications.
If any one of non HTML resource is not available or failed to download, the same script will be
aborted by throwing an error.
If application having java script files, prefer to use URL mode.
2. Script:
Script option will allow you to generate the auto think time, limits number of lines in a script.
3. Protocols:
Displays opted/chosen protocol.
4. Code generation:
Allow you to conduct auto scan for dynamic values
5. Configuration:
Dealing with only auto correlation by specifying record scan, replay scan, rules scan, correlation
function, min and max length of dynamic value.
6. Rules or Correlation Studio (till 11.0):
We can create our own rules for common dynamic values. Those rules will be used across the
project.
Step 1: Create new application.
Step 2: Create new rule by providing LB, RB, param.
Note: We have to select boundary based scan type
Step 3: Test the rule.
Step 4: You can export the rule by clicking export button.
Step 5: You can import the rule by clicking import button.
Note: Correlation rule extension is “.cor”
7. Advanced:
We can generate auto text verification function using this option.
We can generate auto headers.
Scenario 2: Once the test is completed, we have to request DBA, flashback the database or load
previous database instance.
Scenario 3:
Q: One of the script is generating purchase order number and second script is processing
same purchase order number. What is your approach to design the script?
Or
How to pass value from one script to another?
Solution 1: Create two actions in one script for both of the scenarios. Capture purchase order
number from 1st action and pass into the second action.
Solution 2:
Data Staging:
Execute the first script with multiple users in controller. Write purchase order numbers into local
file before starting actual test. Copy purchase order numbers from local file. Load into second
script so that both of the script will execute simultaneously.
Solution 3:
VTS (Virtual Table Server):
Virtual Table Server is a tool that enables sharing of test data and parameters between
LoadRunner Virtual Users (VUsers). Usually performance testers use parameterization in their
scripts, but in Virtual Table Server it acts as centralized repository to store data which can be
shared between VUsers during the test execution.
Regular Expressions
Whenever you have dynamic LB & RB, we can use regular expressions. This function works on
expression but not on boundaries.
Steps to construct regular expressions:
Step 1: Copy the LB & RB from generation log.
Step 2: Construct the expression.
Step 3: Validate in www.rubular.com
Step 4: Write web_reg_save_param_regex() function.
Example:
web_reg_save_param_regex(“parameter name = reg_exp”,
“regex=name =\” u[a-z]er[A-Z]ession\” \\value=\”(.*?)\” , LAST);
Q: In one of my application, we failed to record some of the get and post requests.
Solution: We used fiddler to develop the script
Manual scenario: Manually we have to design the scenario by providing ramp up, ramp down,
duration, number of users to generate the anticipated load against the application.
Percentage mode: It will distribute the load in between use cases in terms of percentage.
Goal oriented scenario: Controller itself will design the scenario as per the goal.
2. Run tab:
User Status:
Down
Pending
Initialization
Ready
Run
Rendezvous
Passed
Failed
Error
Gradual exiting
Exiting
Stopped
Gradual exiting: Whenever test duration completed by all the time user are in mid of the
iteration. So those users will be moved to gradual exiting once the iteration is finished
users will be come out from test.
Note: elapsed time stats whenever you hit the start button.
3. Diagnostics tab: By default web page diagnostics are available at free of cost. We have to buy
license for java, Siebel, sap, oracle etc.
Manual scenario
Check list:
1. Choose manual scenario.
2. Push the script into controller.
3. Choose schedule by scenario (or) schedule by group.
4. Choose real world (or) basic schedule.
5. Assign the quantity.
6. Assign load generators.
7. Verify connectivity with LG’s.
8. Configure SLA’s (if required).
9. Configure runtimes settings for every script.
10. Set the result path.
11. Provide ramp up, ramp down, duration.
Note: whenever situations demands like every script should run for multiple durations with vary
ramp up’s then you can choose schedule by group.
Goal oriented scenario: controller itself will design the scenario according to goal.
Check list:
1. Choose goal oriented scenario.
2. Push the scripts into controller.
3. Click on edit scenario goal.
4. Provide profile name.
5. Provide goal type and threshold point.
6. Provide max and min users.
7. Provide duration once it reaches the goal.
8. Configure notifications if it is not able to reach goal.
9. Distribute load in terms of percentage.
10. Assign LG and check the connectivity.
11. Configure SLA’s (if required).
12. Set the result path.
Q: How to verify the errors for which request, which user, which LG, which line number,
which script, how many time occurred, which user id?
Check list:
Click on errors.
Verify each and every error for which script it was occurred by choosing script column.
Verify which LG it was occurred by choosing generators column.
Verify which user id causing the issue by choosing vuser id column.
IP Spoofing:
Masking the original IP address and using the different IP address is called IP spoofing.
Whenever load balancer is not functioning. Due to the request source of IP address. We have to
mask the original IP address and mask sure that every user has to use different IP address.
Process: In realistic environment every end users using different IP address to access the
application but in LR environment all the users are invoking from same LG and same IP which is
not realistic.
Step1: Request IT infrastructure guys to provide dynamic IP address
Step2: Ask them to configure these IP address in DHCP (dynamic host control protocol) server.
Step3: We have to configure these IP address in load generator using IP wizard option.
Step4: Enable IP spoofing option in controller.
Load balancing: Load balancer is a URL, which will distribute load in between web instances.
As part of performance testing you will receive two kinds of URL.
1. Direct URL: It will access web instance directly.
2. Load balancer URL: which will distribute the load in between web instances.
Q: While running the test how to verify whether load balancing is happening properly are
not?
A: While running the test we have to monitor resource utilization (C.P.U and Memory) each and
every instance. If all the instances are using same level of C.P.U and memory, then we can
conclude that LB is happening properly. If any one of the instance reporting less C.P.U memory
utilization then we have to conclude LB is not happening properly.
Q: What are the actions you can perform while running the test?
A:
1. Add the users.
2. Delete or kill the users.
3. Add the script.
4. Disable or delete the script.
5. Verify the user runtime viewer.
6. Verify the user log.
7. Verify how many users running currently.
8. Add or change the LG for down status users.
9. Identifying which transactions are passing and failing.
10. Verify who the users are ramping up, throughput, hits per second, connections, response time
and resource utilization.
Runtime settings
Extension of RTS is “.cfg” & “.usp”.
Note: RTS will be transferred to controller from vugen script but not vice versa.
4. Think time:
Think Time is the time to choose new action after getting previous response.
(or)
Time delay b/w the User actions.
Note: Even you can pass float numbers as a think time.
Scenario2:
Higher think time will give good response times.
Due to the higher think time server will get more breathing time which will process the
request very fast.
5. ADDITIONAL ATTRIBUTES:
To declare the Environment variables.
Q: How to create environment variables in LR?
(or)
How to pass a new value in to the script without opening the script?
A:
char * server;
server = lr_get_attrib_string(“host”);
lr_save_string(server,”url”);
Write the above statement in the script.
Set the value in the RTS and pass vary arguments in runtime.
6. Miscellaneous:
Continue on Error:
Continue script execution even when an Error Occurs.
Generate snap shot on Error:
It will generate the snap shot for every Error you can verify them in Result file (or) Controller
vuser log (by clicking camera symbol).
Q: Where we can find a screen shot?
A: Go to the vuser log and click on the camera symbol.
Navigate to the LG results path and you can find HTML page for every error.
Multithreading:
Run vuser as a process:
For all client server apps (SAP GUI or Desktop based apps. EX: SAP GUI/ Calculator) you have
to run vuser as a Process.
If we are running vuser as a process every vuser required one MDRV (Multi Driver Program)
Engine.
Every MDRV engine required 5Mb memory in the LG Machine.
7. Network:
Speed simulation:
It specifies to use maximum/ predefined/ custom band width for your test.
Usually we are using maximum bandwidth option until or unless there is a requirement, we are
not going to use custom or advanced bandwidth.
If you like to test your application with a specific network bandwidth, then use custom or
advanced bandwidth.
8. Browser Emulation:
It will allow you to use multiple browsers for test.
Note:
Prerequisites:
We should install the browser in the load generator.
1. Simulate browser cache: Enabling this option instructs the users to use or simulate cache files
from browser.
If disable this option, cache files will be deleted or will not be simulated.
2. Simulate a new user on each iteration: If the users are iterating for multiple times, we have
to make him behave like a new user on every iteration by enabling this option
9. Internet Protocol:
Content check:
It is a global text verification option. Verifies the text on every page.
Note: web_reg_find is a local verification point.
Steps:
1. Create application by clicking new application.
2. Create a rule under the application.
3. Provide the text and match case.
4. You can export or import the rule and extension is “.xml”.
10. Proxy:
It will allow you to configure proxy settings for all requests. It will redirect all the requests to
proxy server.
Options are
1) No proxy
2) Obtain proxy settings from browser
3) Custom proxy
11. Preferences:
1) Enable image and text check:
This option has to be enabled for web_find and web_image_check.
2) Wininet replay instead of socket:
For NTLM based applications or SSL based applications, you can use wininet replay.
If you don’t want to use web_set_socket option, then use wininet replay.
Options:
HTTP request connection timeout: A unit time within which request connection
operation should finish. Default is 120 seconds.
HTTP request receive timeout: A time unit within which receive operation should
finish. Default is 120 seconds.
Step Download timeout: A time unit within which entire step has to be finished. Default
is 120 seconds.
12. Download filters:
To exclude or include specific URL, use download filter option.
Q: How to design shared RTS? (or) How to configure RTS for multiple scripts?
A: Two ways we can configure the shared RTS
1) Vugen level: Configure RTS in one script, copy “.cfg” and “.usp” files and paste into
remaining script folders.
2) Controller level: Select all scripts and choose shared RTS and configure the same.
Note: Whenever script having vary number of actions and names, you should not create shared
RTS or should not copy “.cfg” and “.usp” files to some other scripts.
SLA configuration:
SLA configuration will allow you to compare derived statistics with expected statistics.
Step 1: Click on new under SLA
Step 2: Choose SLA measurement like total, average, throughput, hits per second, response time
and errors.
Step 3: Provide threshold point and click on finish.
Rendezvous test:
Rendezvous point is the point to instruct the users to wait at a certain location once the specified
number of users arrived at that point. It will execute the subsequent request.
Syntax:
lr_rendezvous(“xyz”);
Step 1: Write the function in the script.
Step 2: Go to controller and select rendezvous under scenario.
Step 3: Configure the policy by providing number of users and timeout.
Pacing Calculations
(or)
Little’s Law:
(or)
How to calculate TPH (Transactions per hour)?
Step 2:
Time for target iteration =Target iteration * 1 iteration time
=60*30
=1800 sec
Step 3:
Remaining Time = Target time‐ Target iteration time
=3600‐1800
=1800sec
Step 4:
Pacing =Reaming time/Target iterations
=1800/60
=30 sec
Scenario 2:
Reverse Engineering:
Step 1:
Iteration time = Script time + Pacing
= 30+30
= 60 seconds/one iteration
Step 2:
Total Number of transactions = Number of iteration * one iteration time
= 60 * 60
= 3600
Formulae:
Pacing calculation P = R/I Remaining time R = D-(T*I) Number of iterations I = T/S
P Pacing D Duration I Number of iterations
R Remaining Time T Target transactions T Target transactions
I Number of iterations I Number of iterations S Script transactions
Formulae 2:
Number of users = Pacing P = R+T
TP*(R+T) R Response time
TP Throughput per T Think time
second
R Response time
T Think time
Q: How to add multiple load generators for single script?
Solution:
Select the group
Click on vusers
Add new LGs against vusers
Q: On what basis you are deciding how many LGs required for test?
Solution: Based on below parameters, you can decide how many LGs are required
1. Number of users
2. LG configuration
3. Script variables and size
4. Protocol type
5. Running vuser as a thread or process
Note: You have to conduct a memory footprint test and decide how many users can support by
LG.
Memory footprint test: Testing with single user or 20 users and 50 users conducting how many
users it can sustain called memory footprint test.
Current version of LR will send the notification whenever it reaches the threshold point.
Q: How to copy scheduler settings (ramp up, duration and ramp down) from one script to
another script?
Solution: Using copy scheduler options, we can copy the scheduler settings from one script to
multiple scripts.
Scenario 1:
In one of my application, we design the test by Ramping up user for one every 5 seconds.
But failed to execute this test due to the application crash?
Solution:
Application in working with minimal users but failing in full blown test. So we requested help
from architect people or developers and return the same test. They found problem is with load
balancer due to the rampup rate.
Whenever we are ramping up the users fastly, LB pushing all users into one instance which is
causing the failure. So they suggested to increase the rampup time.
Common controller output messages
Connection to load generator fail or process lr_bridge.exe was not created on host machine
(or)
Communication error fail to connect to remote host or two way communication fail
Solution 1: Verify both machines whether those machines are on same network or not.
Solution 2: Verify both machines by pinging.
Solution 3: If there is a proxy server in between both of the machines, speak with IT admin
people to open the port number.
Solution 4: If there is a firewall in between both of the machines, speak with IT admin people to
install listeners in LGs under MI Listeners.
Files and users are not transferring to the LG
Causes:
Script path is too long, reduce the path.
Parameter naming convention might be a problem. Parameter naming convention should
not have any special characters.
Script might be corrupted, fix the issue.
Script naming convention should not contain any special characters.
Parameter naming convention should match with “.dat” file naming convention in
“.prm” file
Solution:
Open “.prm” file, change the naming convention.
Time out exceeded while waiting to receive data from the URL
Cause: Network issue or application issue.
Solution: If network or application is very slow, increase the timeout limit
Compilation error
Cause: Syntax issue, code issue… in the script
Solution: Open the script and fix the same.
C interpreter error
Cause: Runtime error which is caused by C code.
Solution: Fix the C code issue.
Performance center is a web based application, which is a web interface of controller. Using PC
we can design, execute, and download the results from anywhere any time. Using PC you can
manage your resources (controller, LCD and no. of users) in perfect manner by hooking time
slots.
Advantages:
1. It is a web based application.
2. You can monitor the resources in b/w your team members.
Options or Tabs:
1. Status: Shows how many test executions are currently running, upcoming schedule test
& how many recently ran (executed).
2. Host: Host shows how many LGs, controllers, firewalls connected to the PC.
3. Timeslots: Here you can book the timeslots for your test by specifying duration tests,
number of users and number of LGs.
Note: You have to book extra 15 min to import the Results
Vusers scripts: Here you can upload, download, copy the scripts from other
project, and also duplicate, view & delete the scripts.
Lunch the ALM application using URL upload the scripts in to ALM by zipping or save as option
on my computer.
Navigate the test plan under testing,
Move the script test plan by creating a folder.
Click on edit test, to provide by number/ percentile, manual/ or goal, by group /or by schedule
Push script into scenario, provide RTS, ramp up, ramp down, duration, LG and load distribution.
Click on submit button.
Go to time slot, book a specific time or block a specific time by L.G by providing no. of users
date, start time and end time.
Note: you can manually specify the L.G’s or you can choose automatic option.
You can start the test automatically or manually.
Go to test results, choose your run id, download RAW- results or zip file.
Menu:
Dashboards
Managements
Requirements
Cloud settings
Testing
Resources
Defects
Performance center
Defect: When there is a deviation between the actual and expected, we have to raise a ticket
under defect tab by providing severity, priority, expect, actual results, attachments.
Testing host: It will allow you to verify how many LG’S and controllers are configure whether
those are operational are not operational and in which location or hosted.
Types of testing
3) Load Test:
Load testing is the testing to verify the application behavior under load.
We are designing the scenario with 100% load.
5) Stress Test:
Stress test is the test to identify the breaking point or performance degradation point of
application.
We can stress the application in two ways:
1) By increasing the number of users
2) By reducing the pacing and think time
Note: We can increase the number of transactions by reducing the pacing and think time without
adding the users.
Q: I have license for 500 users but client asked me to test the scenario for 700 users.
Solution: To achieve the above objective, we reduce the pacing and think time to generate more
number of transactions. Usually we are designing the scenario with 1.25X, 1.5X, 1.75X, 2X, 3X,
4X, 5X loads.
In three ways, you can add the vusers
1) Design the scenario and add the users manually for every time interval.
2) Design the scenario with more number of users using pause and resume scheduler, you can add
the users automatically.
3) Using real world scenario, you can add multiple actions for multiple rampups and durations.
8) Benchmark Test:
Benchmark test will give a repeatable set of quantifiable results which from current and future
releases. These results has to be compared with baseline test results.
9) Spike Test:
We have to test the application behavior under abnormal conditions.
Q: If the controller crashes before collating the result, what is your approach to recover the
file?
Solution: If the controller crashes before collating the result, we can recover the result file.
Process:
Go to load generator
Select details
Copy the path of the log
Connect to LG through RDP
Navigate to same path
Copy “.eve” and “.log/.map” files & Paste them into controller result path
ANALYZER
Analyzer file Extension is “.lra”
1. Cross results option: Allow you to compare two “.lrr” files as part of benchmarking test.
2. Section explorer: Contains “.lrr” path, period, duration, average throughput hits per second,
total throughput, hits per second, transaction response time and status code.
4. Properties: Allow you to exclude/ include think time and generate percentage response time.
5. Controller output message: Controller error message will be displayed which will be help full
to analysis.
7. Raw data: Based on the request we can pull the raw data and send to architecture people to
analysis purpose.
12. Reports:
By default we can generate doc report, Html report, crystal report, PDF report.
Reporting:
Once the test got completed, I will export the response times to excel and I will prepare a
comparison report.
Comparison report:
It compares 90th percentile response times with baseline response times of previous test results
and I will maintain a RAG (Red Amber Green) status.
In some other tab, I will copy merged graph to understand the test results.
Apart from comparison report, we will prepare a quick analysis summary which contains
objective, scope, how we designed the scenario, test environment, observations in terms of
resource utilization, high response times and controller, web server logs.
I will send a mail to get AWR, NMON reports for future analysis.
I will prepare a PPT by analyzing all the supporting files (AWR, NMON …) by mentioning
objective, observations, environment comparison, high response transactions, root causes to
present to the stake holder.
Q: How to generate the reports?
A:
Choose reports
Navigate to report template
Click on generate report
Save on required format.
Analysis Process
Client side statistics analysis (analyzer, throughput, Hits per second, Response time)
Server side statistics analysis. (Hardware and OS level statistics).
Application side statistics (Methods, I/O operations, DB, EJB, Packages etc..)
Configuration setting analysis (Current limit, Connection limit, Thread limits..etc..)
Overlay graph:
2. Tile Graph:
View the contents of two charts that shares a common X-axis one-above the others.
Ex: Hits per second and throughput
3. Collate Graph:
Plot two Y-axis of two charts against each other’s.
Scenario1:
Relation between Hits per second and throughput.
Both should be directly proportional, if not
Scenario3:
Relation between throughput and response time.
Both should be inversely proportional.
Note: As per the market standard both should be inversely proportional based on boundaries (if
you are testing pages).
Scenario4:
Relation between running users and connections
Both should be directly proportional, if not
Thread Status:
New
Blocked
Runnable Waiting
Timed Waiting
Terminated
Thread contention:
Thread contention is a status in which one thread is waiting for a lock which is locked by some
other thread.
Deadlock:
Deadlock is a situation where one or more threads are waiting for other resources which are
locked by some other threads.
Thread synchronization:
This code will allow the threads to use multiple resources by multiple threads.
In Java, every object has one monitor. At any point of time, only one thread get lock on monitor.
Other threads will wait until monitor will be released.
Note: Thread dumps will be published with the help of jstack or jvisualvm.
As part of analysis, we are going to identify which threads are in blocked status and waiting
status.
If you find any blocked threads, verify for which stack it is looking for, who locked on expected
stack, copy these details and post to developer.
If you find waiting threads, we have to find which methods are executing for particular thread
(wait (), park (), sleep ()) and copy details and post to developer.
If multiple threads are trying to get locks on stacks which is locked by some other threads causes
deadlock threads. Apart from above analysis, we do have internal thread analyzer tools.
Using these tools, we are deducting the deadlocks and thread level issues. For infrastructure level,
we have to take CPU sampling, which thread is utilizing more CPU and report the same.
Memory Dump:
Memory dump is a snapshot of memory utilization statistics in a particular time period.
Whenever you received OOM (Out of memory) exception or memory leakages we have to take
the memory dump to find out the root cause.
We do have two types of memories
1. Stack memory: Static variables will be loaded into stack memory
2. Heap memory: Dynamic variables will be loaded into heap memory.
Memory dump contains below information:
Objects
Classes
Class Names
Class loader information
Fields
Primitive fields
Garbage collection roots
Thread level data
Stacks
To understand the memory dump, we should drill down how many threads required for our
application, how much memory required by each and every thread will give detailed idea about
memory footprint (static)
Memory dump will give static memory and dynamic memory information (user session) for
analysis purpose.
Using memory dump, we can identify which object, class are running for more time, we can copy
them and send to the developer.
If you are not able to analyze the memory dump manually, we can use memory dump analyzer
tools to identify the issue.
Memory dump extension is “.phd” or “.hprof”
1. JConsole:
JConsole is a default profiling tool for JVM. To leverage the services we have to install JDK.
Here We can only view Hardware Statistics such as CPU, memory, threads, classes
By default we can view CPU, memory, threads, classes as part of garphs.
Overview Of JConsole:
2. JVisualVM:
JVisualVM is a default profiling tool for JVM. To leverage the services we have to install JDK.
Steps to invoke JVisualVM:
My Computer
Program Files
Java
bin
JVisualVM
We can Monitor
1.Local Machine
2.Remote Machine
1. Overview:
Here we can view how much memory?, XMS & XMX settins, JVM version, JRE Version
Here we can check JVM Arguments & System Properties
2. Monitor:
By default we can View CPU,Memory,Classes,threds graphs
Here we can perform GC and we take heap dump
Heap dump extension is “.hprof”
Here we can check memory leakge with the help of heap metaspace graph.
3. Threads:
Here we can view thread status like Running(), Sleep(), Park(), Waiting()
And we can take thread dump for Analysis Purpose.
Note 1: For thread dump analysis copy the thread dump and paste it in any online thread analyzer
tool.
Note 2: We can’t copy Thread dump from remote machine to local machine and vice versa.
4. Sampler:
Here we can view how much CPU & Memory Utilized by each & every thread as part of
JVisualVM.
Overview Of JVisualVM:
Monitoring Tools
Site scope:
It is an agent less monitoring tool or online monitoring tool.
It is a server monitoring tool, to monitor any kind of servers.
At a time, we can monitor 120 servers.
We have to configure the web, app and DB to site scope.
We can monitor for every time interval at any point of time from anywhere in the world.
By using this, we can monitor windows, UNIX and ax-box.
We need to install the site scope in your machine.
We need to configure server in site scope.
We can add monitoring profiler in site scope.
It is a product of HP, and latest version is 11.52.
Launch the site scope URL and provide credentials after that we are able to see the following tabs
Monitor – Here we can add counter to monitor which server you want.
Remote Server – In this, we can configure win, UNIX servers.
Templates
Preference
Server statistic
Tools
Adding servers:
Open Site Scope
Monitor
Remote servers
UNIX remote systems
2. Dynatrace:
Step1: Login to dynaTrace server via dynaTrace client 5.5 installed on your desktop using your
NTID and password.
First open the dynaTrace client 5.5 and click on “Settings”dynaTrace Server as shown below
Step 2: You will get a new window where you are asked to enter the server details and your
credentials.
Click on “Test connection”. Once the connection is established click on click on “Apply” and
then “OK”
There are 2 dynaTrace servers configured for TPT environment and they are b0185-app0246-s
and b0185-app0247-s, so ensure that you login to the server where your project profile has been
created.
The below table contains the server and the system profile of Emerging Business applications.
Sl no Application Dynatrace server System Profile
1 Interlink Not Applicable Not Applicable
2 Encompass B0185-app0247-s XH_EncDashBoard
3 Northlight B0185-app0246-s DR-Northlight
4 Drivewise B0185-app0246-s F9DRVWISE-8-TPT
5 NQ2/MyAccount/Allstate.com B0185-app0246-s IMT
Once you launch dynatrace, you can select the system profile on which you wish to
work/monitor.
Each profile has servers configured for monitoring. IMT profile has 4 servers (2 web and 2 app
servers) configured. Here we can monitor the infrastructure and the applications alternately by
selecting the desired one. In infrastructure we can monitor the servers performance, the CPU &
Memory utilized etc.
You can also select any specific server and view further details like the applications running on
each of these servers, the OS and its version running on the server, number of CPU cores, IP
Address of the server, number of applications processes running and also their type.
You can further select any application running on the server. Here you can see application
process specific details like process id associated with this process, Garbage Collection occurred
at various generation levels, Suspension time caused due to Garbage Collection, CPU Used by
this application process and also thread count.
To monitor the application i.e. the exceptions thrown during the test, errors generated,
webservices being called, webrequests, response times, graphs for CPU consumption at the
process level, we have to create a new “Dashboard”. In the menu bar, click on
DashboardNew to create a new Dashboard.
In the next screen select either of “Use for Analysis” or “Use for Monitoring” as per requirement.
After this you will be asked to select a “Dashlet” for your dashboard. Initially you can select any
of the dashlet among the various options. Later you can add new dashlets, delete existing
dashlets.
In the dashlet, details specific to the dashlet for the last 30 minutes will be present. You can
further alter the time duration for which you want view data. You can also select a past date/time
during which a test would have executed a week ago.
Please Note: Since the dynatrace client is configured on your local desktop, the client would
consider your local desktop time for fetching any details stored on the dynatrace server. So, if a
test is executed during EDT time(assume a test was executed during 23/07/2014 13:28:49 -
23/07/2014 14:55:01 EDT) and your desktop is configured in IST time zone, then to fetch the
details of the test, you must convert the test execution time in EDT to IST(23/07/2014 10:58:49
PM - 24/07/2014 12:25:01 AM IST) before fetching the sessions.
You can also fetch details specific to a particular transaction by entering the purepath name for
the specific transaction.
It is also possible to generate graphs for various system resources consumption during the test.
You have to use the “Charting” dashlet to generate graphs.
Please read the below section on how to save/store the dynatrace sessions for a particular duration
at a shared location.
Every project that has been configured on dynaTrace has a unique profile name.
Select the profile name for which you want to export the session. The profile name can be found
under “System Profiles”. For Encompass Dashboard, the profile name is XH_EncDashboard
When you expand the Profile, you can see various tabs as shown below.
You can go to any of the desired tab to see the corresponding details.
When you are exporting the session, you have to right- click on the profile, and select “Session
storage” “Export Session”.
Once you select “Export Session” you get a new window as shown below where you are asked to
enter the file path where the session has to be stored. The file will be stored with “.dts”
extension.
Also, enter the duration of the test execution to store the session under Timeframe.
Note: The duration of the test executed in controller is in CST timezone and if you are exporting
the dynaTrace session and the time zone of your machine is not in CST, then convert the
corresponding CST time to your local time zone and then export the session(because the client is
configured to your local time zone).
Under “Content” select “PurePaths and time series” or anything as per your requirement and
finally click on “Export”.
3. HP Shunra:
HP Shunra is created by Shunra, acquired by HP.
Before 11.0, we used to call it as WAN Emulator.
After 11.0 onwards, we used to call it as Network Virtualization.
Steps:
Install Shunra in Controller.
Install Shunra agent in Load Generator.
Once the test is finished, filter the response times based on the response times and report the
same.
Steps to use Shunra in controller:
Design the scenario in controller
Click on network virtualization/location virtualization
Choose per group
Create profiles by configuring the .ntx files
Assign the profile against every script
Conduct the test
Open .lra file, filter the response times based on host names and report the same.
Perfmon:
It is a default monitoring tool to monitor windows operating systems based servers.
Start
RUN
Type Perfmon
Click ok.
Process:
Right click on counter logs
New log settings
Provide the output file name
Add servers & objects along with counters
Define time interval
Provide the output file name and Schedule settings.
Bottlenecks
Bottleneck is an issue which causes delays Response Time.
We have to find bottlenecks in below areas:
1. Network
2. Hardware
3. Code/Application
4. Configuration Settings
1. OACore issue: Oacore process the requests and consumes the memory from JVM heap.
Scenario 1: I have an application called oracle R12/oracle apps/Ebiz which has to support 300
users, expected response times are below 5 seconds. While ramping up the users, application
performance is degraded at 100 user load. Even application itself crashed at 150 user load.
Process: Initially we started analyzing client side statistics and found that issue with server side.
Then we analyzed OS/hardware/code/DB but we did not find anything. So moved to DB layer,
finally we found an issue with JVM settings which is a oacore settings (memory management
configuration).
After analyzing oacore settings, we recommended them to tweak that setting from oacore = 1 to
oacore = 3 which resolved the issue.
3. Dead locks:
Dead lock is a situation which causes longer wait or makes transaction failure.
Ex: if the user A locked on Table 1 requested lock on Table 2, which is locked by user B. Both
are not willing to release the locks which will cause failure transaction.
With the help of DBA we can find Dead locks.
Dead locks occur due to DB poor design.Oratrace can be used to find Dead locks in AWR
Reports.
User A Table 1
User B Table 2
5. Memory leakage:
It is a concept deals with memory management to execute any program or task we require
Memory.
Memory has to be de‐allocated from unused variables or un‐referencive variables by GC
Engine.
If the memory is not de‐allocating from un‐referncive variables causes memory leakage.
To find out memory leakage issue we have to conduct availability test.
GC Engine:
It is a mechanism automatically loads in to the system and de‐allocates memory from un‐
returncive objects.
Note 1: How often GC Engine is loading in to the system.
Note 2: How long it is taking de allocating memory from the un‐referencive objects.
Heap graph should be in teeth pattern, and it should not be an upper trend graph.
6. Thread limit:
We found an issue server reached the max number of simultaneous connections in server log.
Cause: Not enough threads in Apache.
Statistics: Due to the connection pool settings, application is not able to handle simultaneous
connections created by 150 users.
Recommendations: Increase the connection pool settings from 10 to 16.
7. Heap memory issue in Tomcat:
In one of my business object application, we received an error “web intelligence is busy contact
BO admin”.
Cause: High CPU utilization triggered by JVM process.
Recommendation: Upgrade the heap memory in template.
Note
By default, every thread privileged CPU time will be allocated.
12. High Memory Utilization:
To perform any action, we required memory. High memory utilization impacts the application
performance and transaction response time.
Recommendation: Upgrade the memory.
Counters:
1. Available Memory
2. Committed Bytes
3. Cached Bytes
4. Page faults per second
5. Page reads per second
6. Page writes per second
Database bottlenecks:
1. Low buffer hit ratio:
Process: Generated AWR report and found low buffer hit ratio which is reported 60%. BHR
should be more than 95%.
Cause: Due to allocation of low memory to the buffer memory, triggers low BHR.
Recommendation: Recommended DB architect people to increase buffer memory allocation by
redesigning oracle SGA.
Soft parsing:
Except step 1, it will perform all above steps.
Recommendation:
1) Alter the shared memory pool size.
2) Verify the binding variables in query.
6. Disk Counters:
Disk read per second:
Disk writes per second: rate of write operations on the disk.
Average disk queue length: Number of read and write request that were queued for selected disk
during the sample interval.
Disk time: percentage of the elapsed time that the selected disk was busy with serving read and
write request.
Note:
Average disk queue length should not cross to for every disk.
Split I/O‘s Second: Measures the rate of I/O split due to file fragmentation.
Free space: Display the percentage of total available space.
7. Database Counters:
We can monitor oracle 10g versions using DB stats reports above 10g. AWR reports.
Note: Even DBA can generates the DB trace (or) oracle trace report to identify dead locks and
full table scan.
Oracle counters (for all java based applications):
Buffer hit ratio
Full table scan
Indexing
DB time
DB CPU time
Hard parses and soft parses
Top 5 time taken events(in a particular durations)
Physical read Physical writes
High CPU utilized query’s
High memory utilized query’s
High I/O’s utilized query’s
Counters:
Buffer cached hit ratio.
Transactions for second.
Log cached hit ratio.
Page read per second.
Page writes per second.
The following example shows a typical recording for an SAP Portal client:
Example:
vuser_init()
{
web_reg_find("Text=SAP Portals Enterprise Portal 5.0",
LAST);
web_set_user("junior{UserNumber}",
lr_decrypt("3ed4cfe457afe04e"),
"sonata.hplab.com:80");
web_url("sapportal",
"URL=http://sonata.hplab.com/sapportal",
"Resource=0",
"RecContentType=text/html",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=/SAPPortal/IE/Media/sap_mango_polarwind/images/header/branding_image.jpg",
"Referer=http://sonata.hplab.com/hrnp$30001/sonata.hplab.coml:80/Action/26011[header]"
, ENDITEM,
"Url=/SAPPortal/IE/Media/sap_mango_polarwind/images/header/logo.gif",
"Referer=http://sonata.hplab.com/hrnp$30001/sonata.hplab.com:80/Action/26011[header]",
ENDITEM,
...
LAST);
The following section illustrates an SAP Web and SAP GUI multi-protocol recording in which the
Portal client opens an SAP control. Note the switch from web_xxx to sapgui_xxx functions.
Example:
web_url("dummy",
"URL=http://sonata.hplab.com:1000/hrnp$30000/sonata.hplab.com:
1000/Action/dummy?PASS_PARAMS=YES=;dummyComp=dummy=;
Tcode=VA01=;draggable=0=;CompFName=VA01=;Style=sap_mango_polarwind",
"Resource=0",
"RecContentType=text/html",
"Referer=http://sonata.hplab.com/sapportal",
"Snapshot=t9.inf",
"Mode=HTML",
LAST);
Note: The Open Connection step uses one of the connection names in the SAP Logon
Descriptions list. If the specified connection name is not in the list, the Vuser looks for a server
with that name.
In the following section, the functions emulate typical user operations such as menu selection
and the setting of a check box.
The following example illustrates a multi-protocol recording in which the SAP GUI client opens a
Web control. Note the switch from sapgui to web functions.
Login to application
Using R2 level T-code we can enable the server side scripting. “RZ11”.
Example:
sapgui_tree_double_click_item("Use as general WWW browser, REPTITLE",
"shellcont/shell",
"000732",
"REPTITLE",
BEGIN_OPTIONAL,
"AdditionalInfo=sapgui1020",
END_OPTIONAL);
sapgui_set_text("",
"http:\\\\yahoo.com",
"usr/txtEDURL",
BEGIN_OPTIONAL,
"AdditionalInfo=sapgui1021",
END_OPTIONAL);
3. Web Services Protocol:
If the application is communicating with the help of 3rd party services (XMB/Rest Ful
XMLs/JSONs) we have to use web service protocol.
If the application is developed in SOAP. We can develop the scripts in 2 ways using below
protocols.
1. Web HTTP/HTML.
2. Web Services.
Select the XML in request plan.Execute the XML by providing authentication details and method
type.
Verify the response whether it is correct or not by validating HTTP status code & XML.
Note: Correlation, parameterization capturing and is same like web HTTP/HTML protocol.
http://www.webservicex.net/globalweather.asmx?WSDL.
Now Click on Add Web Service Call on top nav bar. Give the Input Arguments and Leave the out
put arguments empty. And click on ok. As shown in the following image.
It will create a script in loadrunner as shown below. You can perform the steps one by one in this
way for all the web services steps. You can use lr_xml_find and lr_xml_get_values to validate the
page.
web_service_call( "StepName=GetCitiesByCountry_101",
"SOAPMethod=GlobalWeather|GlobalWeatherSoap|GetCitiesByCountry",
"ResponseParam=response", "Service=GlobalWeather", "ExpectedResponse=SoapResult",
"Snapshot=t1396977083.inf", BEGIN_ARGUMENTS, "CountryName=India", END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT, LAST);
Enhancements:
To capture the dynamic value from the above request. We used below request
Lr_xml_get_valules(“XML={response}”, // input argument
“valueparam=outputparam”, //output argument
“query=//sendSMSResult”, //query string like LB/RB
LAST);
Verification Points:
Lr_xml_find(“XML={response}”,
“value=name is”,
“query= //sendSMSresult”,
LAST);
3) By invoking the SOAP UI through Vugen:
1. Open the Vugen.
2. Invoke the SOAP UI by providing SOAP UI file path.
3. Then execute the all the requests under project.
4. Above process will allow you to record the objects with the help of SOAP request.
Note:
Correlation we can capture the dynamic values with the help of lr_xml_get_values( ).
Functions:
1) ctrx_nfuse_connect(): connects to a citrix server via an NFUSE portal.
2) ctrx_sync_on_window(): waits until a window is created (or) become active.
3) ctrx_mouse_click(): Emulates a mouse click on a citrix client sent to a citrix server.
4) ctrx_wait_for_event(): It is a synchronization function that waits for an event to occur.
5) ctrx_get_window_name(): Retrieves the name of the active window.
6) ctrx_type(): Emulates a typing alpha numeric keys.
7) ctrx_key(): Emulates a non‐alpha numeric keys.(Tab,uparrow,dowm arrow...)
8) ctrx_sync_on_bitmap(): waits until a bitmap appears.
Challenges:
1) My test got failed in controller
Cause: citrix_ICA agent version is different in LG & vugen machines.
2) My mouse click objects were failed in controller.
Cause: Resolution is different in LG & vugen machines.
3) Synchronization issue:
Case study 1: Synchronization issue is the biggest issue in citrix protocol. To overcome
synchronization issue we have 4 ways.
i) Based on window name
ii) Based on bitmap value
iii) Based on wait for an event function
iv) Based on sync text
AWR REPORTS
Why we are using AWR report?
A: To analyze the database utilization.
Hard parsing:
In hard parsing, it will follow below steps.
DB (Database) will fetch sql query from hard disk.
It will check for syntax and also for Symantec
It will parse the sql query.
It will keep in the shared pool memory and fulfil the request.
Soft parsing:
It will simply fetch passed sql query from shared pool memory and it will fulfil the request.
If percentage is 91% then it is good
If percentage 100% then we need to increase shared pool memory size.
Processor Queue Length: This Performance Monitor counter displays the number of threads waiting to be
executed in the queue, which all the processors on your system share. If this counter has a sustained value of
two or more threads, you have a processor bottleneck on your hands. The problem could be a renegade
component or a poorly written application, but it might just be that your system is overloaded.
% Processor Time: The percentage of the processor time that is used to process user or system transactions as
opposed to the CPU sitting idly. The higher the processor usage, the more the CPUs are being used to process
user or system transactions
Disk - % Idle Time: This counter provides a very precise measurement of how much time the disk remained in
idle state, meaning all the requests from the operating system to the disk have been completed and there is zero
pending requests.
This is how it’s calculated, the system timestamps an event when the disk goes idle, then timestamps another
event when the disk receives a new request. At the end of the capture interval, we calculate the percentage of the
time spent in idle. This counter ranges from 100 (meaning always Idle) to 0 (meaning always busy).
Disk - Physical Disk -- Avg. disk queue length: The number of read and write requests that are queued for the
physical disk subsystem. The higher the average disk queue length, the more resources are waiting for earlier
requests to finish prior to fulfilling their request
Disk - Avg. Disk sec/Transfer (Avg. Disk sec/Read, Avg. Disk sec/Write):
Displays the average time the disk transfers took to complete, in seconds. Although the scale is seconds, the
counter has millisecond precision, meaning a value of 0.004 indicates the average time for disk transfers to
complete was 4 milliseconds.
This is the counter in Perfmon used to measure IO latency.
I wrote a blog specifically about measuring latency with Perfmon. For details got to “Measuring Disk Latency
with Windows Performance Monitor”.
Memory - Pages/sec – measures the number of pages per second that are paged out of RAM to Virtual Memory
(HDD)or ‘hard faults’ OR the reading of memory-mapping for cached memory or ‘soft faults’ (systems with a
lot of memory). Average of 20 or under is normal.
- This counter needs to be used in conjunction with Paging File: %Usage. If the Pages/sec are high, but the %
Usage is low, these are soft faults (cached memory). If both are high, these are hard faults (working set
replacement).
- To look for excessive paging, use Task Manager and add the column: Page Faults and PF Delta for current
activity.
Memory - Page Faults /sec: Measures the working set. (high count indicates working set is too large for
memory to handle - could be a mix of hard and soft faults)
Memory - % Committed Bytes: Bytes in Use (Memory\% Committed Bytes in Use) for the system has
exceeded the threshold. Overall system performance may significantly diminish which will result in poor
operating system and application performance.
VSS Client Software to be installed into our local machines (Project members machines)
Administrator will create the users for VSS & he will provide access permissions for all users (Project mebers)
to access VSS Repository.
Permissions:-
a) Read
b) Check out, Check in
c) Add, Rename, Delete
d) Destroy
Processor:
The Test Engineer responsibilities are: 1. Check-out files(Copy files from VSS) 2. Check-in files.
1. Check-out:
A) Go to project folder, select the file & right click the file & Click on view & save as the file to local
working folder. (or) select files & Right click files & click on ‘Get Latest version’.
B) This is the way we can get the required documents (Test plan, Requirements specification,
functional requirements, templates & Test cases) from VSS.
2. Check-In files:
A) First we need to create ‘set working folder’
B) check-out the file from VSS to local working folder.
C) Go to file menu – click on ‘set working folder’. Browse & select existing working folder & click on
OK. Now go to file & right click the file & click on check out, observe file is copied to local working
folder.
D) Do the necessary modifications in file & saves the file into local machine. Go to VSS, right click the
file & click on check in, observe modification is updated successfully & new version will be created
automatically with your modifications.
E) Even we can go back to the previous versions, right click the file & click on ‘show history’. Even
we can compare the files.