{"id":44584,"date":"2017-01-05T11:36:02","date_gmt":"2017-01-05T06:06:02","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=44584"},"modified":"2017-01-05T11:43:37","modified_gmt":"2017-01-05T06:13:37","slug":"introduction-to-jmeter","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/introduction-to-jmeter\/","title":{"rendered":"Introduction to JMETER"},"content":{"rendered":"<p><b>BASICS OF JMETER<\/b><\/p>\n<p><span style=\"font-weight: 400\">Apache Jmeter is an open source testing software. Jmeter is 100% pure Java desktop application used for <a title=\"Testing Services\" href=\"http:\/\/www.tothenew.com\/testing\/automated-independent-manual-testing\">performance testing<\/a> and evaluating the overall system performance under different loads. Jmeter is easy to use and can be downloaded for free of cost. It\u00a0can work with many types of tests categories such as load, performance, functional, regression, etc. Jmeter is compatible with JDK 5 or the higher versions of JDK. By Using Jmeter we can make an application robust and reliable.<\/span><\/p>\n<p><b>Many protocols that are served or supported by Jmeter:<\/b><\/p>\n<ul>\n<li><b><span style=\"font-weight: 400\">HTTP, HTTPS sites<\/span><\/b><\/li>\n<li><span style=\"font-weight: 400\">Web Services <\/span><\/li>\n<li><span style=\"font-weight: 400\">Database via JDBC drivers <\/span><\/li>\n<li><span style=\"font-weight: 400\">Directory \u2013 LDAP<\/span><\/li>\n<li><span style=\"font-weight: 400\">JMS <\/span><\/li>\n<li><span style=\"font-weight: 400\">SMTP<\/span><\/li>\n<li><span style=\"font-weight: 400\">FTP Services<\/span><\/li>\n<\/ul>\n<p><b>Some Additional Features of Jmeter:<\/b><\/p>\n<ul>\n<li><b><span style=\"font-weight: 400\">Available\u00a0free of cost as it is an open source software.<\/span><\/b><\/li>\n<li><span style=\"font-weight: 400\">Simple and user-friendly GUI, even a layman with little information about Jmeter can use it.<\/span><\/li>\n<li><span style=\"font-weight: 400\">Capable of conducting performance and load test for different servers like HTTP, HTTPS, SOAP, Mail- POP3, LDAP etc.<\/span><\/li>\n<li><span style=\"font-weight: 400\">Jmeter is a platform independent application. On\u00a0windows, testing on Jmeter can be initiated\u00a0using the jmeter.bat file, and on\u00a0Unix\/Linux, by clicking on Jmeter Shell Scripts.<\/span><\/li>\n<li><span style=\"font-weight: 400\">Jmeter creates and stores its test plan in XML format. That indicates that we can generate or create a test plan using a text editor.<\/span><\/li>\n<li><span style=\"font-weight: 400\">Jmeter is a multi-threading framework which is used for concurrent sampling using multiple threads.<\/span><\/li>\n<li><span style=\"font-weight: 400\">It is also helpful in automated functional testing.<\/span><\/li>\n<\/ul>\n<p><b>Basic Components of Jmeter:<\/b><\/p>\n<p><b>Test plan: <\/b><span style=\"font-weight: 400\">It is a feature\u00a0in Jmeter tool where all the settings for executing a test are described\/mentioned. It describes the chain of steps Jmeter has to execute when tests are run. A test plan consists of Thread Group, Timers, Configuration Elements, Listener, Assertion, etc. Jmeter offers customization as it can be used depending upon the user requirement.<\/span><\/p>\n<p><i><span style=\"font-weight: 400\">It is not mandatory to save a test plan before running a script because Jmeter will ask the user to save test plan while executing the script. But it is a good practice if we save a test plan before running the script.<\/span><\/i><\/p>\n<p><strong><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-44600 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/test-plan.png\" alt=\"Jmeter test plan\" width=\"1366\" height=\"728\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/test-plan.png 1366w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/test-plan-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/test-plan-1024x545.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/test-plan-624x332.png 624w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/strong><\/strong><\/p>\n<p><b>Workbench:<\/b><span style=\"font-weight: 400\"> This is like working area. Items present on the workbench:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400\">HTTP Proxy Server<\/span><\/li>\n<li><span style=\"font-weight: 400\">Config Element<\/span><\/li>\n<li><span style=\"font-weight: 400\">Property Display<\/span><\/li>\n<li><span style=\"font-weight: 400\">Logic Controller<\/span><\/li>\n<li><span style=\"font-weight: 400\">HTTP Mirror Server<\/span><\/li>\n<li><span style=\"font-weight: 400\">Assertions &amp; Listener etc<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><\/li>\n<\/ul>\n<p>HTTP Proxy Server listens to the requests sent from the web browser to the server. It automatically\u00a0creates HTTP Request samplers for every request sent to the server.<\/p>\n<p><strong><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-44601 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/work-bench.png\" alt=\"work bench\" width=\"1366\" height=\"728\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/work-bench.png 1366w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/work-bench-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/work-bench-1024x545.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/work-bench-624x332.png 624w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/strong><\/strong><\/p>\n<p><b>Thread Group:<\/b><span style=\"font-weight: 400\"> Thread group elements are the starting points of our test plan. As it goes straight with the name. The thread group elements handle the number of threads Jmeter will execute during the test run against the application. We can manage following things by\u00a0using thread group:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Number of thread to run<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Ramp Up time (how long it will take to start all the threads)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Number of iteration (Loop count)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Scheduler (it is optional)<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-44602 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Thread-Group.png\" alt=\"Jmeter Thread Group\" width=\"1366\" height=\"728\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Thread-Group.png 1366w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Thread-Group-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Thread-Group-1024x545.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Thread-Group-624x332.png 624w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><b>Sampler: <\/b><span style=\"font-weight: 400\">Sampler is responsible for sending a specific type of request to the server. Samplers produce a user request for a page from the target server. For instance, we can have an HTTP Request Sampler if we need to perform different operations like POST, GET, DELETE on HTTP services or web applications. Jmeter has a different type of sampler. \u00a0HTTP Request Sampler is the sampler used for testing web applications. Samplers do the actual work for Jmeter and produce or generate one or more sample results. The sample results can be viewed in different listeners. Some majorly used samplers are listed below:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">HTTP Request<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">FTP Request <\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">JDBC Request<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Java Request <\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">SOAP\/XML Request <\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">RPC Request <\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">BSF Sampler<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Debug Sampler<\/span><\/li>\n<\/ul>\n<p><strong><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-44603 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Samplers.png\" alt=\"Jmeter Samplers\" width=\"1366\" height=\"728\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Samplers.png 1366w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Samplers-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Samplers-1024x545.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Samplers-624x332.png 624w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><b>Assertion:<\/b><span style=\"font-weight: 400\"> Assertion is something which is executed after every sampler is in the scope. These are extra checks performed on samplers. It facilitates users to test the proof about the responses received from the application under test. Moreover, we may use assertions for high volume load testing where the user expectation is to determine how much load an application can handle before crashing. To apply assertion to a particular sampler, it is added as the child of that particular sampler. If an assertion fails while running a script, then Jmeter highlights that assertion. <\/span><\/p>\n<p><strong>Some assertions are listed below:- <\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Beanshell Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">BSF Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Compare Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">JSR223 Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Response Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Duration Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Size Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">XML Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">BeanShell Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">MD5Hex Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">HTML Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">XPath Assertion<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">XML Schema Assertion<\/span><\/li>\n<\/ul>\n<p><strong><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-44604 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Assertions.png\" alt=\"Jmeter Assertions\" width=\"1366\" height=\"728\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Assertions.png 1366w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Assertions-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Assertions-1024x545.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Assertions-624x332.png 624w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><b>Logic Controller:<\/b><span style=\"font-weight: 400\"> Logic controller lets you control the order in which samplers are processed. If a request is coming from child elements of a sampler, then using logic controllers we can change the order of requests. Logic controllers provide a procedure for managing the flow of thread group. Having a logic controller in the thread group is like having an if-then or do-while logic in a program.<\/span><\/p>\n<p><strong>Logic controllers are listed below:<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Simple Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Loop Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Once Only Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Interleave Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Random Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Random Order Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Throughput Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Runtime Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">If Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">While Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Switch Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">ForEach Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Module Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Include Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Transaction Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Recording Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Critical Section Controller<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">jp@gc &#8211; Parameterized Controller<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-44606 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Logic-Controllers.png\" alt=\"Jmeter Logic Controllers\" width=\"1366\" height=\"728\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Logic-Controllers.png 1366w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Logic-Controllers-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Logic-Controllers-1024x545.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Logic-Controllers-624x332.png 624w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><b>Listener: <\/b><span style=\"font-weight: 400\">listener records the results generated by the samplers. We can see these results in the form of graphs, tables, trees, or simple text in some particular case. In other words, they provide a visual form to the data gathered by Jmeter after executing as sampler component. Many of the listeners perform several tasks in addition to &#8220;listening&#8221; to the test results. They also provide a way to view, save, and read saved test results. Listener records the test result of the sampler component which is at or below its level. If there are a lot of samplers in a thread group, then listener may consume a lot of memory. Most of the listeners now-a-days keep a local copy of every sample in their scope.<\/span><\/p>\n<p><strong>Some listeners provided by Jmeter are:<\/strong><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Sample Result Save Configuration<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Graph Full Results<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Graph Results<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Spline Visualizer<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Assertion Results<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">View Results Tree<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Aggregate Report<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">View Results in Table<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Simple Data Writer<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Monitor Results<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Distribution Graph (alpha)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Aggregate Graph<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Mailer Visualizer<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">BeanShell Listener<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Summary Report<\/span><\/li>\n<\/ul>\n<p><strong><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-44607 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Listener.png\" alt=\"jmeter Listener\" width=\"1366\" height=\"728\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/12\/Listener.png 1366w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Listener-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Listener-1024x545.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/12\/Listener-624x332.png 624w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">JMeter is used to reduce bottlenecks and improve the web server application. Here is another interesting <a title=\"Use Case of Load Testing Using JMeter\" href=\"http:\/\/www.tothenew.com\/blog\/advance-use-case-of-load-testing-using-jmeter\/\">use case on performing load testing using Jmeter<\/a>. <\/span><\/p>\n<p><span style=\"font-weight: 400\">This blog serves only as a starting point of learning JMeter; there is much more to learn and to do. Keep exploring.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BASICS OF JMETER Apache Jmeter is an open source testing software. Jmeter is 100% pure Java desktop application used for performance testing and evaluating the overall system performance under different loads. Jmeter is easy to use and can be downloaded for free of cost. It\u00a0can work with many types of tests categories such as load, [&hellip;]<\/p>\n","protected":false},"author":1039,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":20},"categories":[1818,1994,1,1816],"tags":[4350,696,1563,4349],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/44584"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1039"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=44584"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/44584\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=44584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=44584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=44584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}