5.18k likes | 8.75k Views
Apache JMeter. By Mohamed Talaat mtalaat@arxict.com 2009-03-31. Agenda. Performance/Load testing What is JMeter? What is a JMeter Test Plan ? Test Plan Elements Demo. Testing – Performance/Load. Performance testing How fast an application under a particular workload
E N D
Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31
Agenda • Performance/Load testing • What is JMeter? • What is a JMeter Test Plan ? • Test Plan Elements • Demo.
Testing – Performance/Load • Performance testing • How fast an application under a particular workload • Demonstrates that the system meets the performance criteria • Validate and verify the quality attributes. • Load testing • Modeling the expected usage by simulating the multiple users accessing the web services concurrently. • Test when does the web application blow up?
JMeter • Apache JMeter : - 100% pure Java desktop open source application - Full Swing and lightweight component - Designed for functional/performance/load testing - Simulate heavy load (application/ server/network) - Full multithreading framework - Different protocol types (HTTP/FTP/JDBC/SOAP/JMS,..)
JMeter - Test plan • A test plan describes a series of steps JMeter will execute when run. • Test plans consist of: • Thread groups • Samplers • Logical controllers • Listeners • Timers • Assertions • Configuration elements
Thread Groups • Thread group element is the beginning point of any test plan (All controllers and samplers must be under a thread group) • Each thread represents a user (e.g. setting the thread group to 1000 simulates 1000 users)
Samplers • Samplers tell JMeter to send requests to a server and wait for a response. • Do the actual work in JMeter and interact with the server you are loading. • Examples for Samplers: FTP Request - HTTP Request - JDBC Request - WebService (SOAP) Request ,…
Listeners • The information produced by samplers are consumed by listeners • Listener shows details of sampler requests and responses, and can display basic HTML and XML representations of the response. • Popular listeners: • Graph Results (plots the response times on a graph) • View Results Tree Note : all Listeners save the same data; the only difference is in the way the data is presented on the screen.
Logic controllers • Control the flow of the test plan. • Customize the logic that JMeter uses to decide when to send requests. • Logic controllers: • Loops • Conditionals • Ordering • Only once controllers • Interleave controllers
Assertions • Allow you to assert facts about responses received from the server being tested for functional testing. • You can add an assertion to any Sampler • Example assertions for HTTP Request Sampler: • Response code • Response text • HTML assertion
Configuration Elements • Set default values for other parts of the test plan as well as configure variables. • A configuration element works closely with a Sampler. • Examples: - HTTP Request Defaults: Save the time when doing lots of HTTP Samplers - HTTP Cookie Manager: used with HTTP Request samplers to automatically send cookies with the request
Timers • By default, a JMeter thread sends requests without pausing between each request. • The timer will cause JMeter to delay a certain amount of time before each request that a thread makes.
Summary- Testing process Plan Test Create Thread Group Create Test Scripts Run Test Plan Analyze Results Listeners Test plan Thread Group Samplers and Timers
Demo _________________________
References • http://en.wikipedia.org/wiki/Software_performance_testing • http://jakarta.apache.org/jmeter/usermanual/test_plan.html • http://jakarta.apache.org/jmeter/usermanual/get-started.html • http://en.wikipedia.org/wiki/JMeter