Successfully reported this slideshow.
Your SlideShare is downloading. ×

Introduction to JMeter

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Basic of jMeter
Basic of jMeter
Loading in …3
×

Check these out next

1 of 78 Ad

Introduction to JMeter

Download to read offline

Apache JMeter is an Apache project that can be used as a load testing tool for analyzing and measuring the performance of a wide range of services, with a particular emphasis on web applications

Apache JMeter is an Apache project that can be used as a load testing tool for analyzing and measuring the performance of a wide range of services, with a particular emphasis on web applications

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

Similar to Introduction to JMeter (20)

Advertisement

Recently uploaded (20)

Introduction to JMeter

  1. 1. INTRODUCTION TO JMETER
  2. 2. ABOUT ME Galih Lasahido galih.lasahido@gmail.com An enthusiastic Java developer that you can rely on •11+ years of experience in programming •8 years of experience in Banking payment •String knowledge in Java and PHP •ISO 8583 payment expert •JPos-ee contributor
  3. 3. PERFORMANCE TESTING
  4. 4. PERFORMANCE TESTING Performance testing is in common testing performed to decide how a framework performs in terms of responsiveness and steadiness beneath a specific workload. Load Testing Load testing is the simplest shape of Performance testing. A load test is as a rule conducted to get it the behaviors of the framework beneath a particular anticipated stack.
  5. 5. PERFORMANCE TESTING Stress testing Stress testing is typically used to determine the system's upper limits of capacity. This type of test is performed to determine the system's robustness under extreme load. Bottle neck A bottleneck is a feature in which the overall performance or capacity of a system is constrained by a single or limited number of components or resources. Your web application may be made up of several modules that are used to process requests. If one of them has a technical limitation, the overall system performance suffers.
  6. 6. PERFORMANCE TESTING Volume testing Volume testing is performed against the application's efficiency. A massive amount of data is processed through the application (which is being tested) in order to test the system's extreme limitations. Endurance Testing This type of testing is used to ensure that the system can withstand a large number of transactions over a long period of time. The test will be run with a defined set of concurrent users for an extended period of time, say 5 to 10 hours or 2 to 3 days.
  7. 7. PERFORMANCE GOALS Spike Testing Spike testing involves abruptly increasing the number of users' load by a large amount and observing the system's behavior. The goal is to determine whether or not the system will degrade in performance, fail, or be able to handle dramatic changes in load.
  8. 8. PERFORMANCE GOALS Concurrency/throughput Transactions per second the application under test can handle Server response time Amount of time the application under test takes to process a request after it has received.
  9. 9. WHAT IS JMETER
  10. 10. WHAT IS JMETER Apache JMeter is an Apache project that can be used as a load testing tool for analyzing and measuring the performance of a wide range of services, with a particular emphasis on web applications. Can load and performance test many different server types: •Web - HTTP, HTTPS •SOAP •Database via JDBC •LDAP •JMS •etc
  11. 11. WHERE TO DOWNLOAD JMETER https://jmeter.apache.org/download _jmeter.cgi
  12. 12. JMETER BASIC ELEMENTS Test Plan Thread Group Sampler Assertion Listener Logic Controller Timer Config Element Pre-Processor/Post-Processor
  13. 13. TEST PLAN A test plan describes a series of steps that JMeter will take when it is run. A comprehensive test strategy will consist of one or more Thread Groups, logic controllers, sample generating controllers, listeners, timers, assertions, and configuration elements.
  14. 14. THREAD GROUP Thread group elements serve as the starting point for any test plan. A thread group must be assigned to all controllers and samplers.
  15. 15. SAMPLER JMeter is told by samplers to send requests to a server and wait for a response. They are handled in the order in which they appear in the tree.
  16. 16. ASSERTION Assertions allow you to assert facts about responses from the server under test. Using an assertion, you can effectively "test" that your application is returning the expected results.
  17. 17. LISTENER Listeners allow access to the information gathered by JMeter about the test cases while Meter is running.
  18. 18. LOGIC CONTROLLER Logic Controllers allow you to modify the logic that JMeter employs to determine when to send requests. Logic Controllers have the ability to reorder requests from their child elements. They can change the requests themselves, make JMeter repeat requests, and so on. JMeter provides several Logic Controller, which are as follows: Critical Section Controller ForEach Controller If Controller Include Controller Interleave Controller Loop Controller Module controller Once Only Controller Random Controller Random Order Controller Recording Controller Runtime Controller Simple Controller Switch Controller Throughput Controller! Transaction Controller While Controller
  19. 19. INTERLEAVE CONTROLLER Interleave Controller will select only one samplers/requests stored in it, to run in each loop of the thread. It will execute the samplers sequentially. You can give descriptive name for the controller (optional) If checkbox is selected, the interleave controller will consider sub-controllers as single request elements and permit only one request per controller at a time (optional) Let’s consider an example of Interleave Controller, where Thread Group contains “Number of Threads” to “1”, “Loop Count” to 5, and a total of “4” Samplers (Http requests). Total 1 * 5 * 4 = “20” requests will be sent to web server under test without using any Logic Controller. You can see details in the below figure:
  20. 20. INTERLEAVE CONTROLLER You can see “4” Requests/Samplers under Interleave Controller node on the left panel. Only 5 Http Requests are being sent to the web server (one request for each loop)
  21. 21. LOOP CONTROLLER For Example, Thread Group loop count is set to “2”, Loop Controller loop count is set to “2”, and “3” requests are present under Loop Controller node, then JMeter will send a total of “30” Http Requests to the web server under test. Total Requests (12) = Thread Group loop count (2) * Loop Controller loop count (2) * Number of Requests inside Loop Container (3) Let’s compare the requests sent with or without Loop Controller: Without Loop Controller, “6” requests are sent to the web server:
  22. 22. LOOP CONTROLLER After adding Loop Controller with Loop Count to “2”, a total of “12” Http requests are sent to the web server.
  23. 23. MODULE CONTROLLER Module controller adds modularity to the JMeter Test Plan. Normally we construct test plan consists of small units of functionality like Login, Add Product, Logout. The functionality can be stored inside Controllers as modules e.g. “Test Fragment” can be used to store each module inside it. In order to run modules in other thread, so when the test fragment is change, you don’t need to change every thread that are using it.
  24. 24. INCLUDE CONTROLLER Include Controller is made to use an external test plan. This controller allows the usage of multiple test plans in JMeter.
  25. 25. INCLUDE CONTROLLER
  26. 26. RANDOM CONTROLLER Random Controller is similar to “Interleave Controller” except that it makes samplers/requests to run in random order in each loop. For Example, you have defined “3” Dummy requests under “Random Controller”, then these requests will be sent based on the number of thread in Thread Group in random sampler and will be decided on rum- time.
  27. 27. RANDOM ORDER CONTROLLER Random Order Controller is similar to “Interleave Controller” except that it makes samplers/requests to run in random order in each loop. For Example, you have defined “3” Dummy requests under “Random Controller”, then these requests will be sent in random order and their order of execution will be decided on rum-time.
  28. 28. SIMPLE CONTROLLER Simple Controller helps in organizing and storing the Samplers and other Logic Controllers. It doesn’t offer any other functionality like other controllers.
  29. 29. RUNTIME CONTROLLER Runtime Controller controls the execution of its samplers/requests for the given time. For example, if you have specified Runtime(seconds) to “20”, JMeter will run your test for 20 seconds only.
  30. 30. RECORDING CONTROLLER Recording Controller is a place holder where proxy server can save recorded requests. It has no effects on test execution. As you can see in the following figure:
  31. 31. TIMER JMeter will delay a certain amount of time before each sampler in its scope as a result of the timer.
  32. 32. CONFIG ELEMENT A configuration element collaborates with a Sampler. Although it does not send requests (with the exception of HTTP Proxy Server), it can add to or modify existing ones.
  33. 33. PRE-PROCESSOR/POST- PROCESSOR •A Pre-Processor performs some action prior to making a Sampler Request. •Following the submission of a Sampler Request, a Post- Processor performs some action.
  34. 34. EXECUTION ORDER 1. Config Element 2. Pre-Processor 3. Timer 4. Sampler 5. Post-Processor 6. Assertion 7. Listener
  35. 35. FUNCTION AND VARIABLES
  36. 36. LIST OF FUNCTIONS https://jmeter.apache.org/usermanual/functions.html
  37. 37. HTML REPORT FROM COMMAND AND GUI
  38. 38. All report generator properties can be found in file reportgenerator.properties. To customize these properties, you should copy them in user.properties file and modify them. Configuring Dashboard Generation
  39. 39. Make a report folder in JMETER_HOME/bin JMETER_HOME/bin/jmeter -n -t templates/iso8583.jmx -l report/log -e -o report/ Using Command
  40. 40. Open report folder in JMETER_HOME/bin and open index.html using browser
  41. 41. Save result file into csv format Using GUI
  42. 42. Open Generate HTML report and fill the values, then Generate report Using GUI
  43. 43. JMETER PLUGINS
  44. 44. WHERE TO DOWNLOAD JMETER-PLUGIN https://jmeter- plugins.org/install/Install/
  45. 45. INSTALLING PLUGINS The easiest way to get the plugins is to install Plugins Manager. Then you'll be able to install any other plugins just by clicking a checkbox. Download plugins-manager.jar and put it into JMETER_HOME/lib/ext directory, then restart JMeter.
  46. 46. RECORD WEB REQUEST Automatic REST API Request
  47. 47. INSTALL BLAZEMETER CHROME PLUGINS Go to https://chrome.google.com/ and search for blazemeter
  48. 48. RUN BLAZEMETER PLUGINS Press the record circle button, and in the web login to the page
  49. 49. RUN BLAZEMETER PLUGINS After scenario is done, you can export the file to jmeter format
  50. 50. RUN BLAZEMETER PLUGINS
  51. 51. RUN BLAZEMETER PLUGINS
  52. 52. OPEN IN JMETER
  53. 53. HOW TO RECORD API FROM DEVICE Automatic REST API Request
  54. 54. CREATE TEMPLATE
  55. 55. RUN PROXY SAMPLER Get you mobile phone and install CA Root Jmeter file, the file it self located in JMETER_HOME/bin/Apache JMeterTemporaryRootCA.crt
  56. 56. HOW TO INSTALL JMETER CA ROOT FILE IN ANDROID
  57. 57. SETTING PROXY IN ANDROID PHONE For hostname insert you laptop ip address, and port will be the same like in Jmeter HTTP(S) Test Script Recorder
  58. 58. RESULT OF TAPPING DATA After all the the config, run you application from you mobile phone, and the result will automatically shown in the JMeter
  59. 59. ADD PREPROCESSOR FOR ENCRYPTING PASSWORD USING AES
  60. 60. ADD FILE CSV CONFIG
  61. 61. FINAL REQUEST WITH CSV DATA AND ENCRYPTED AES PASSWORD
  62. 62. ISO 8583 TESTING USING JMETER
  63. 63. ISO 8583 TEST PLAN Checking “Run Thread Groups consecutively” will result a serial request per- thread, while unchecking can result a parallel request thread
  64. 64. STAN VARIABLE
  65. 65. ISO8583 CONNECTION CONFIGURATION
  66. 66. INQUIRY SAMPLER
  67. 67. XPATH EXTRACTOR
  68. 68. BEANSHELL POSTPROCESSOR Since XPATH EXTRACTOR only live in the active thread, so we need to make it available in other thread
  69. 69. SYNCHRONIZING TIMER Optional features
  70. 70. PAYMENT SAMPLER
  71. 71. ISO 8583 TESTING USING JMETER STRESS TEST
  72. 72. STRESS TEST By Using the Synchronizing Timer, and set the Thread to a certain concurrent request that you want, the request will hold until all thread are ready
  73. 73. DISTRIBUTED TEST ENVIRONMENT
  74. 74. MASTER: THE SYSTEM IS RUNNING A METER GUI, WHICH IS USED TO CONTROL THE TEST. SLAVE: THE SYSTEM RUNNING JMETER-SERVER, WHICH ACCEPTS RECOMMENDATIONS FROM THE GUI AND SENDS THEM TO THE TARGET SYSTEM. TARGET: THE LOAD TEST WAS PLANNED BY THE WEB SERVER. Configuration: 1. Copy same version of Meter to different computer. 2. Add remote node IP in jmeter.properties file. 3. Run Meter on remote machine using JMETER_HOME/bin/jmeter- server (in command prompt) 4. Start Meter GUI in host machine. 5. Select any test plan. 6. Go to Run >> Remote Start >> Remote IP Address.
  75. 75. EDIT THE PROPERTIES FILE ON THE CONTROLLING JMETER MACHINE. IN JMETER_HOME/BIN/JMETER.PROPERTIES, FIND THE PROPERTY NAMED "REMOTE_HOSTS" AND ADD THE VALUE OF YOUR RUNNING JMETER SERVER'S IP ADDRESS. MULTIPLE SUCH SERVERS CAN BE ADDED, COMMA-DELIMITED.
  76. 76. RESTART JMETER AFTER EDIT THE FILE

×