{"id":75,"date":"2018-03-25T11:54:18","date_gmt":"2018-03-25T11:54:18","guid":{"rendered":"http:\/\/berkkibarer.com\/?p=75"},"modified":"2018-03-26T19:42:59","modified_gmt":"2018-03-26T19:42:59","slug":"load-test-correlation","status":"publish","type":"post","link":"https:\/\/www.berkkibarer.com\/?p=75","title":{"rendered":"Load Test Correlation"},"content":{"rendered":"<h3>As seen on: Loadium.com;<\/h3>\n<p class=\"p1\"><span class=\"s1\"><a href=\"https:\/\/loadium.com\/designing-test-plans-with-controllers-the-right-way\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-32\" src=\"http:\/\/berkkibarer.com\/wp-content\/uploads\/2018\/03\/loadium-1@2x-e1521976024407.png\" alt=\"\" width=\"112\" height=\"32\" srcset=\"https:\/\/www.berkkibarer.com\/wp-content\/uploads\/2018\/03\/loadium-1@2x-e1521976024407.png 306w, https:\/\/www.berkkibarer.com\/wp-content\/uploads\/2018\/03\/loadium-1@2x-e1521976024407-300x86.png 300w\" sizes=\"auto, (max-width: 112px) 100vw, 112px\" \/><\/a>\u00a0\u00a0<\/span><\/p>\n<hr \/>\n<p class=\"p1\"><span class=\"s1\">In today\u2019s world, we have to deal with various behaviors of systems while communicating with one another. In most cases, to carry on with test scenarios, we need to fetch the dynamic responses from preceding requests and pass it to the subsequent ones. By simply parsing and passing the needed data to the next caller provides a smooth transition during the test execution process (Load Test Correlation).<\/span><\/p>\n<p class=\"p2\"><span class=\"s1\"><b>Storyline:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Since load\/stress testing scenarios are based on mutual interactions between the client and remote, the need of correlation is a technical state every performance tester encounters at some point. To establish a strong bond with your test flow, JMeter comes with a handy feature: Regular Expression Extractor under Post Processors.<\/span><\/p>\n<p class=\"p2\"><span class=\"s1\"><b>Tagline:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Reliability of your tests depends on the frequency of buggy occurrences, how robust your design is and how ready you are for unexpected situations.<\/span><\/p>\n<p class=\"p2\"><span class=\"s1\"><b>When using static parameters is not enough\u2026<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">After spending some time and going through the basics of JMeter, it is inevitable not to get stuck with handling dynamic data in your complex scenarios. At this very point, correlation kicks in.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Getting the data parsed from the response on the fly and passing it to the next request, plays a vital role in your test flow. Jmeter supports correlation with its \u201cRegular Expression Extractor\u201d which provides smooth data transition by using regular expressions and applies the parsed data on another sampler in our flow.<\/span><\/p>\n<p class=\"p2\"><span class=\"s1\"><b>Why regular expressions?<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Regular expressions are a set of symbols &amp; characters which are used to build a pattern to match character combinations in strings. Regular expressions are very popular and used widely in programming languages and very easy to get used to.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">JMeter\u2019s regular expressions are provided by Jakarta ORO framework based on Perl5 Regex Engine. There are many great tutorials, websites, and articles about it, so take your time and you should be writing your style of patterns in no time.<\/span><\/p>\n<p class=\"p2\"><span class=\"s1\"><b>How JMeter handles correlation\u2026<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">JMeter\u2019s Regular Expression Extractor helps us fetch any portion of data from the response by using regular expressions. Since applying the regular expressions on the response is a post process, this explains why Regular Expression Extractor is located under Post-Processors.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">After matching the set of characters by using the Extractor, this value is set to a variable for future use on another sampler.<\/span><\/p>\n<p class=\"p2\"><span class=\"s1\"><b>Getting to the point\u2026<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Regex Extractor has a few options we need to know in advance.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>A. Apply To:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Main Sample -produced by the primary request- and\/or Sub Sample -produced by any request made related to the primary request- can be picked to apply the regular expression.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>B. Response Field To Check:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">A Regex can be applied to a part of the response message such as header, body etc\u2026<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>C. Reference Name:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">This is the name of the variable which stores the matched data. This variable can later be called from another request by simply using the following syntax: ${}<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>D. Regular Expression:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Your regex pattern goes here.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>E. Template:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Regex may have more than one group. Templates \u2013 regex group index- are used to match the group that contains the data.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>F. Match No:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Multiple matched sets might return for a regex pattern. By setting the match number, data-to-store is chosen from the result set and set to the variable -reference name-.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\"><b>G. Default Value:<\/b><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">If there is no match to the regex, then the default value is set to the variable.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">If you wonder how this technique is applied in practice, please go ahead and take a look at the following link;<\/span><\/p>\n<p class=\"p3\"><span class=\"s2\"><a href=\"https:\/\/loadium.com\/http-live-streaming-performance-test\/\">HTTP Live Streaming Performance Test<\/a><\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Happy Load Testing\u2026<\/span><\/p>\n<p>Berk Kibarer<\/p>\n<hr \/>\n<p>References :\u00a0<a href=\"https:\/\/loadium.com\/designing-test-plans-with-controllers-the-right-way\/\">https:\/\/loadium.com\/designing-test-plans-with-controllers-the-right-way\/<\/a><\/p>\n<p>&nbsp;<\/p>\n ","protected":false},"excerpt":{"rendered":"<p>As seen on: Loadium.com; &nbsp;&nbsp; In today&rsquo;s world, we have to deal with various behaviors of systems while communicating with one another. In most cases, to carry on with test scenarios, we need to fetch the dynamic responses from preceding requests and pass it to the subsequent ones. By simply parsing and passing the needed data to the next caller provides a smooth transition during the test execution process (Load Test Correlation). Storyline: Since load\/stress testing scenarios are based on mutual interactions between the client and remote, the need of&hellip;<\/p>\n","protected":false},"author":1,"featured_media":76,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[1],"tags":[6,7,4,16,8,18,17,5],"class_list":["post-75","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-published","tag-correlation","tag-dynamic","tag-jmeter","tag-load-test","tag-loadium","tag-performance-test","tag-stress-test","tag-test"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75"}],"version-history":[{"count":4,"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":181,"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions\/181"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=\/wp\/v2\/media\/76"}],"wp:attachment":[{"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.berkkibarer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}