Escolar Documentos
Profissional Documentos
Cultura Documentos
What is JMeter
Performance testing tool (like LoadRunner, WebLoad, OpenSTA , etc) It supports performance testing of: Web application
Web services (SOAP and REST) Database query performance Mail - SMTP(S), POP3(S) and IMAP(S) JMS Mobile
Apache Project - http://jmeter.apache.org/ 100% pure Java desktop application Originally developed by Stefano Mazzocchi
Features of JMeter
Load and performance test various protocols
- HTTP(S), FTP, JDBC, JMS, LDAP, SOAP HTTP proxy server for recording test scripts eliminates 3rd party recording tools like Badboy Platform Independent Execution can do in batch mode and analyze offline.
Distributed testing.
Extensible. Plugins (https://code.google.com/p/jmeter-plugins/)
Test Architecture
Strengths
Free and open source
Active development/ community Extensibility Capability of dynamic scripting/ generate load/ and reporting Supports automation (Maven with Jenkins CI for performance testing in regression mode) Cloud compatibility
Weaknesses
Memory management issues But adjust Heap memory/ use 64-bit version/ run non-GUI mode
Reports are a bit lacking But... Plugins provides many Steep learning curve Lack of Training opportunities and require technical skills Limited Support No dedicated support like commercial tools
JMeter Elements
Test Plan: where the overall settings for a test are specified.
Thread groups: defines a pool of users that will execute a particular test case against your server. Samplers: sends requests to a server Logical controllers : control flow of test plan (loops, conditionals, ordering, etc.) Listeners: record, summarize and display record and response data Timers: introduce delays in test plan Assertions: assert facts about responses, for functional testing Configuration elements: Configuration Elements set default values for other parts of the Test Plan as well as configure variables. Pre-processors and post-processors
Workbench :It provides a place to temporarily store test elements while not in use for copy/paste purposes
JMeter Proxy Server : watch and record your actions while you browse your web application with your normal browser
Test plan
Where the overall settings for a test are specified.
Thread group
Thread group elements are the beginning points of any test plan. It controls the number of threads JMeter will use to execute your test
Samplers
Samplers tell JMeter to send requests to a server and wait for a response. Processed in the order they appear in the tree. Controllers can be used to modify the number of repetitions of a sampler. HTTP Request JDBC Request Java object request LDAP Request SOAP/XML-RPC Request FTP Request
Logical controllers
Logic Controllers determine the order in which Samplers are processed
Some controller are: Loop Controller If controller Transaction Controller Recording Controller
Listeners
Listen" to the test results.
View, save, and read saved test results Can be saved to JTL, CSV or XML format.
Listeners can be added anywhere in the test, including directly under the
test plan.
Listeners
Timers
Add delay to script If not, overwhelms your server Ex: Constant timer Random timer Synchronizing timer
Assertions
Verify correctness of your response.
Ex: Response assertion Verify fields of response Size assertion - tests that each response contains the right number of bytes in it Duration assertion- tests response received within a given amount of time
Demo
4. Setting a Proxy in IE
Start Internet Explorer, but do not close Jmeter. From the tool bar, click tools -> internet options. Select the connection tab Click LAN settings button On the connections tab, check Use a proxy server for your LAN.
5. Adding a Listeners
Test Plan -> Thread Group -> Listeners Graph Results View Results in table View Results in tree Aggregate report
Assertions
Assertions allow you to assert facts about responses received from the server being tested. Using an assertion, you can essentially "test" that your application is returning the results you expect it to.
Session Handling