Apache JMeter By Mohamed Talaat [email protected] 2009-03-31.

16
Apache JMeter By Mohamed Talaat [email protected] 2009-03-31

Transcript of Apache JMeter By Mohamed Talaat [email protected] 2009-03-31.

Page 1: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

Apache JMeter

By Mohamed Talaat

[email protected]

Page 2: 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.

Page 3: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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?

Page 4: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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,..)

Page 5: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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

Page 6: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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)

Page 7: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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 ,…

Page 8: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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.

Page 9: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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

Page 10: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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

Page 11: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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

Page 12: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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.

Page 13: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

Summary- Testing process

Plan Test Create Thread Group

Create Test Scripts

Run Test Plan

Analyze Results

Test plan Thread GroupListenersSamplers and

Timers

Page 14: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

Demo_________________________

Page 15: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

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

Page 16: Apache JMeter By Mohamed Talaat mtalaat@arxict.com 2009-03-31.

Thank you!!