Professional Documents
Culture Documents
Http Basics
1.1 HTTP Request-Response Model
HTTP requests are stateless
Web server doesn’t keep track of client’s (browser’s) state
Every request from the browser is a new request to the server by default
Jsessionid=122232234455
Section 2
Apache JMeter
Overview
2.1 What Is JMeter?
A load testing tool for
Http static and dynamic resources
Webservices
JDBC connections
JMS
LDAP
FTP
Generic TCP connections
Just about anything a java program can access (virtually
everything)
A functional testing tool for all of the above
applications
A monitoring solution for all of the above
applications
2.1 What Is JMeter?
Can operate in GUI mode and non-GUI mode
GUI mode is used for building the scripts, testing
the scripts and viewing results (graphical, tabular or
textual results)
GUI mode could also be used for running tests on
systems with enough memory and processing
speed allocated to
Run the JMeter GUI
Run threads for the test
Run data collection and display windows (graphical,
tabular and textual)
2.1 What Is JMeter?
Non-GUI mode is used for medium-high load test
cases and in cases where accuracy is important.
This mode does not need the memory and
processing speed to run and render the GUI
Results get written to log (.jtl) files. GUI could be
used to open and view the results stored in a .jtl
file.
2.1 What Is JMeter?
Can operate in Controller-Server mode
Useful when a single Jmeter instance is unable to
generate heavy load (Threads)
One system could be used as a controller and one
or more other systems could be used as load
generating servers
Controller is responsible for distributing the tests to
the load serves, starting test, collecting and
consolidating the test results.
2.1 What Is JMeter?
Can operate in Controller-Server mode
Useful when a single Jmeter instance is unable to
generate heavy load (Threads)
One system could be used as a controller and one
or more other systems could be used as load
generating servers
Controller is responsible for distributing the tests to
the load serves, starting test, collecting and
consolidating the test results.
Section 3
Elements of JMeter
http://jmeter.apache.org/usermanual/component_reference.html
3.1 Test Plan
3.2 Thread Group
3.2 Thread Group
3.3 Samplers
Used to send requests to servers
Http Request
FTP Request
SOAP Request
LDAP Request
JDBC Request
Java Objects
And counting…
Requires a Thread Group to execute the
sampler
3.3.1 Http Sampler
3.3.1 Http Sampler
3.4 Listeners
Used to listen to test results
Test results could be viewed in graphical, tabular or
textual formats
Test results could be saved to log files
Saved test results could be read and viewed
Several types of listeners
Aggregate Graph
Aggregate Report
Distribution Graph
Summary Report
Results in Table
Results in Tree
etc.
3.4.1 Aggregate Report & Results in Tree
3.4.2 Aggregate Report
${__functionName(arg1, arg2,…)}
JMeter comes loaded with several built-in
functions
(http://jmeter.apache.org/usermanual/functio
ns.html)
Section 4
JMeter Non-GUI
Mode Execution
4.1 Non-GUI Mode
GUI mode should used to build the test scripts
and to test it with small loads
Non-GUI mode should be used for extensive
and accurate load testing
Non-GUI mode is triggered by the command-
line argument “–n”
Example,
cmd:> jmeter –n –t MyTest.jmx –l MyTest.jtl
4.1 Opening a Log File
4.2 Passing Properties In Non-GUI Mode
Properties (Key-Value pairs) could be passed
into Jmeter test script using –D or –G
command-line option
Example,
cmd:> jmeter –n –t MyTest.jmx –l MyTest.jtl
–DserverName=qaweb –DcontextPath=qa1
4.2 Passing Properties In Non-GUI Mode