{"id":4878,"date":"2018-06-18T08:57:01","date_gmt":"2018-06-18T12:57:01","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=4878"},"modified":"2018-06-18T08:57:01","modified_gmt":"2018-06-18T12:57:01","slug":"testing-complex-logic-with-jmeter-beanshell","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/","title":{"rendered":"Testing Complex Logic with JMeter Beanshell"},"content":{"rendered":"<p>BeanShell is one of the most advanced JMeter built-in components. JMeter has rich built-in plugins which cover many needs of a performance test. For example, you might need some additional scripting while writing some complex tests. In such cases, it&#8217;s worth using Beanshell. In this post, we are going to be talking about testing complex logic with JMeter Beanshell and common use cases. Beanshell has the functionality to run java code and has access to JMeter APIs and external classes that are loaded in the JMeter classpath.<\/p>\n<p>JMeter has the following Beanshell enabled components:<\/p>\n<ol>\n<li><code><code><\/code><\/code><a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#BeanShell_Sampler\">Beanshell Sampler<\/a>.<\/li>\n<li><code><code><\/code><\/code><a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#BeanShell_PreProcessor\">Beanshell PreProcessor<\/a>.<\/li>\n<li><code><code><\/code><\/code><a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#BeanShell_PostProcessor\">Beanshell PostProcessor<\/a>.<\/li>\n<li><code><code><\/code><\/code><a href=\"http:\/\/jmeter.apache.org\/usermanual\/functions.html#__BeanShell\">__BeanShell<\/a> function.<\/li>\n<li><code><code><\/code><\/code><a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#BeanShell_Assertion\">Beanshell Assertion<\/a>.<\/li>\n<\/ol>\n<p>Below are the JMeter API classes exposed to Beanshell. If you look at the bottom of Beanshell, you\u2019ll see the list of variables defined for the script.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1016\" height=\"648\" class=\"wp-image-4879\" src=\"https:\/\/d1u7j79bg1ays7.cloudfront.net\/blog\/wp-content\/uploads\/2018\/06\/word-image-4.png\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-4.png 1016w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-4-300x191.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-4-768x490.png 768w\" sizes=\"auto, (max-width: 1016px) 100vw, 1016px\" \/><\/p>\n<h2><strong>SampleResult<\/strong><\/h2>\n<p>You can access the member variables and methods of the <code><code><\/code><\/code><a href=\"https:\/\/jmeter.apache.org\/api\/org\/apache\/jmeter\/samplers\/SampleResult.html\">SampleResult<\/a> Class in Beanshell.<\/p>\n<p>For example, you can set and get the thread name using <code>setThreadName()<\/code> and <code>getThreadName()<\/code> methods respectively.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1016\" height=\"507\" class=\"wp-image-4880\" src=\"https:\/\/d1u7j79bg1ays7.cloudfront.net\/blog\/wp-content\/uploads\/2018\/06\/word-image-5.png\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-5.png 1016w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-5-300x150.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-5-768x383.png 768w\" sizes=\"auto, (max-width: 1016px) 100vw, 1016px\" \/><\/p>\n<h2><strong>ResponseCode<\/strong><\/h2>\n<p>This class allows you to set response code manually. In some situations, you may need to set the response code based on the response that you get from server.<br \/>\nHere is a sample use-case:<\/p>\n<pre>if (condition) {\n  ResponseCode = \"200\";\n}\nelse {\n  ResponseCode = \"500\";\n}\n<\/pre>\n<h2><strong>ResponseMessage<\/strong><\/h2>\n<p>This class allows you to set the response message manually. The sample use case is the same as the one for <code>ResponseCode<\/code>.<\/p>\n<h2><strong>IsSuccess:<\/strong><\/h2>\n<p><code>IsSuccess<\/code> is a <code>Boolean<\/code> that reflects whether the sampler succeeded. If it\u2019s set to true, the sampler is considered to have \u201cpassed.\u201d Otherwise, it will be marked as \u201cfailed\u201d.<\/p>\n<pre>if (condition) {\n  IsSuccess = true;\n}\nelse {\n  IsSuccess = false;\n}\n<\/pre>\n<h2><strong>ctx<\/strong><\/h2>\n<p><code>ctx<\/code> is the most powerful variable exposed to BeanShell. It represents the <code><code><\/code><\/code><a href=\"https:\/\/jmeter.apache.org\/api\/org\/apache\/jmeter\/threads\/JMeterContext.html\">JMeterContext <\/a> class, which is virtually JMeter itself. It provides read\/write access to the underlying JMeter engine, samplers, and their results as well as variables\/properties.<\/p>\n<p>The following code demonstrates the usage of ctx variable:<\/p>\n<pre>log.info(\"Current Sampler class is: \" + ctx.getCurrentSampler());\nlog.info(\"JMeter Engine class is: \" + ctx.getEngine());\n\nlog.info(\"Previous Response Message is: \" + ctx.getPreviousResult().getResponseMessage());\nlog.info(\"Previous Response Code is: \" + ctx.getPreviousResult().getResponseCode());\nlog.info(\"Previous Response URL is: \" + ctx.getPreviousResult().getURL());\nlog.info(\"Previous Response Time is: \" + ctx.getPreviousResult().getTime());\n\nlog.info(\"Previous Domain is: \" + ctx.getPreviousSampler().getDomain());\nlog.info(\"Previous Protocol is: \" + ctx.getPreviousSampler().getProtocol());\nlog.info(\"Previous Port is: \" + ctx.getPreviousSampler().getPort());\nlog.info(\"Previous Method is: \" + ctx.getPreviousSampler().getMethod());\n\nlog.info(\"Thread Name is: \" + ctx.getThread().getThreadName());\nlog.info(\"Thread Start Time is: \" + ctx.getThread().getStartTime());\nlog.info(\"Thread End Time is: \" + ctx.getThread().getEndTime());\nlog.info(\"Start Next Thread Loop on Error: \" + ctx.getThreadGroup().getOnErrorStartNextLoop());\nlog.info(\"Stop Test on Error: \" + ctx.getThreadGroup().getOnErrorStopTest());\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"959\" height=\"242\" class=\"wp-image-4881\" src=\"https:\/\/d1u7j79bg1ays7.cloudfront.net\/blog\/wp-content\/uploads\/2018\/06\/word-image-6.png\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-6.png 959w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-6-300x76.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-6-768x194.png 768w\" sizes=\"auto, (max-width: 959px) 100vw, 959px\" \/><\/p>\n<p>Another use case is if you want to write all Assertions error to an HTML file so you can see which assertion is not working. You can use <code>ctx<\/code> variable in Beanshell assertion to iterate through all samplers in the current context and write the failures in an html file.<\/p>\n<p>Add a Beanshell assertion and copy the following code to write all the assertions to a html file:<\/p>\n<pre>import org.apache.jmeter.services.FileServer;\nf = new FileOutputStream(\"C:\\\\apache-jmeter-4.0\\\\bin\\\\result.html\", true);\npt = new PrintStream(f);\npt.println(\"&lt;html&gt;&lt;body&gt;\");\nfor (a: SampleResult.getAssertionResults()) {\n  if (a.isError() || a.isFailure()) {\n    log.error(\"URL :\"+ ctx.getCurrentSampler().toString());\n    log.error(Thread.currentThread().getName()+\": \"+SampleLabel+\": Assertion failed for response: \" + new String((byte[]) ResponseData));\n    pt.println(\"URL :\"+ ctx.getCurrentSampler().toString());\n    pt.println(Thread.currentThread().getName()+\": \"+SampleLabel+\": Assertion failed for response: \" + new String((byte[]) ResponseData)); \/\/ update here what you want to write\n  }\n  pt.println(\"&lt;\/body&gt;&lt;\/html&gt;\");\n  pt.close();\n  f.close();\n}\n<\/pre>\n<h2><strong>vars<\/strong><\/h2>\n<p>It\u2019s an instance of the <code><code><\/code><\/code><a href=\"https:\/\/jmeter.apache.org\/api\/org\/apache\/jmeter\/threads\/JMeterVariables.html\">JMeterVariables<\/a> class and provides read\/write access to current variables, is capable of enumerating\/changing existing variables, creating new variables, and obtaining nested properties. All JMeter variables are Java strings. If you need to put something else to a JMeter variable, you\u2019ll need to cast it to a string first. The following code snippet demonstrates how to save previous sampler response data into a JMeter variable:<\/p>\n<pre>vars.put(\"ResponceData\", prev.getResponseDataAsString());\nlog.info(vars.get(\"ResponceData\"));\n<\/pre>\n<p><img decoding=\"async\" class=\"wp-image-4882\" src=\"https:\/\/d1u7j79bg1ays7.cloudfront.net\/blog\/wp-content\/uploads\/2018\/06\/word-image-7.png\" \/><\/p>\n<h2><strong>props<\/strong><\/h2>\n<p>Basically, this is the same as <code>vars<\/code>, but it exposes JMeter properties instead. See JavaDoc on <code>java.util.Properties<\/code> and JMeter documentation on JMeter properties for more information. The primary distinction between <code>props<\/code> and <code>vars<\/code> is that props have a \u201cglobal\u201d scope, whereas the scope of <code>vars<\/code> is limited to the current thread group.<\/p>\n<h2><strong>log<\/strong><\/h2>\n<p><code>log<\/code> represents the <code>Logger<\/code> class and can be used to append a message into <code>jmeter.log<\/code> file. The following is the sample use case:<\/p>\n<pre>log.info(\"Test Message with INFO level\");\nlog.error(\"Test Message with ERROR level\");\n<\/pre>\n<h2><strong>Some Common Use Cases of Beanshell<\/strong><\/h2>\n<h4><strong>Writing custom requests in JMeter.<\/strong><\/h4>\n<p>In some cases, you might want to add parameters based on the response. You can do this using the Beanshell preprocessor.<\/p>\n<p>The <code>sampler.addArgument()<\/code> method allows you to add arguments before hitting the server manually.<\/p>\n<h4><strong>Changing JMeter Variables.<\/strong><\/h4>\n<p>As mentioned earlier, you can update JMeter variables on the fly using Beanshell. Assume that you have a user defined variable called \u201ccounter\u201d with the value of \u201c1\u201d. Let\u2019s say you want to increment this counter value by one every time it executes a sampler in while loop. The following code snippet increments the counter value by one and updates the same:<\/p>\n<pre>int counter = Integer.parseInt(vars.get(\"counter\")) +1;\nvars.put(\"counter\",Integer.toString(counter));\n<\/pre>\n<h4><strong>Using a Custom Jar in the Beanshell Sampler.<\/strong><\/h4>\n<p>Assume that you have a requirement to call one of the methods which is present in a user created class. You can call the methods present in user created JAR file using Beanshell.<\/p>\n<ol>\n<li>Place your User created Jar file in <code>lib\/ext<\/code> folder of JMeter.<\/li>\n<li>Restart JMeter to pick the .jar.<\/li>\n<li>Add a Beanshell sampler to your Test Plan and call the method from .jar file as you would do in Java.<\/li>\n<\/ol>\n<p>For Example :<\/p>\n<p>Given you have the following class:<\/p>\n<pre>package timeStampPack;\nimport java.text.SimpleDateFormat;\nimport java.util.Calendar;\npublic class TimeStampConversion\n{\n  public TimeStampConversion() {}\n  public static String getTimeStamps(int count)\n  {\n    String dates = \"\";\n    for (int i = 1; i &lt;= count; i++)\n    {\n      try {\n        Thread.sleep(1L);\n      } catch (InterruptedException e) {\n        e.printStackTrace();\n      }\n      dates = dates + \"TimeStamp\" + i + \"==&gt;\" + getCurrentDateTime() + \"\\n\";\n    }\n    return dates;\n  }\n}\n<\/pre>\n<p>In above class, <code>getTimeStamps()<\/code> method returns timestamp, packages it as timeStamp.jar and copies the file to the <code>lib\/ext<\/code> folder of your JMeter installation.<\/p>\n<p>Add Beanshell Sampler to your Test Plan and put the following code into the &#8220;Script&#8221; area.<\/p>\n<pre>Import timeStampPack.*;\nvar time=TimeStampConversion.getTimeStamps(1);\nlog.info(time);\n<\/pre>\n<p>The above code will call <code>getTimeStamps()<\/code> method and logs the value.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"310\" class=\"wp-image-4883\" src=\"https:\/\/d1u7j79bg1ays7.cloudfront.net\/blog\/wp-content\/uploads\/2018\/06\/word-image-8.png\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-8.png 732w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/06\/word-image-8-300x127.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/p>\n<p>You can also use Beanshell to parameterize test data using CSV file. Check <a href=\"https:\/\/www.redline13.com\/blog\/2018\/01\/load-test-with-unique-users\/\">this article<\/a> to see details.<\/p>\n<h2><strong>How RedLine13 Enhances JMeter Load Testing<\/strong><\/h2>\n<p>JMeter is an excellent open source load testing tool used by thousands of developers. If you\u2019re one of them, you may want to load test. JMeter can be used for load testing. With RedLine13, you can run a <a href=\"https:\/\/www.redline13.com\/blog\/2017\/02\/jmeter\/\">JMeter Load Test<\/a> with your JMX script of any mobile application, web application, or API in 10 minutes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BeanShell is one of the most advanced JMeter built-in components. JMeter has rich built-in plugins which cover many needs of a performance test. For example, you might need some additional scripting while writing some complex tests. In such cases, it&#8217;s worth using Beanshell. In this post, we are going to be talking about testing complex logic with JMeter Beanshell and common use cases. Beanshell has the functionality to run java code and has access to JMeter<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":4171,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,7],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-user","4":"post-4878","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"category-jmeter"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Testing Complex Logic with JMeter Beanshell - RedLine13<\/title>\n<meta name=\"description\" content=\"This post will show the different Beanshell capabilities and use cases for testing complex logic and how RedLine13 can enhance the load testing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Testing Complex Logic with JMeter Beanshell - RedLine13\" \/>\n<meta property=\"og:description\" content=\"This post will show the different Beanshell capabilities and use cases for testing complex logic and how RedLine13 can enhance the load testing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-18T12:57:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2017\/02\/apache-jmeter-redline13-load-testing.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"611\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"RedLine13\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"RedLine13\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/\"},\"author\":{\"name\":\"RedLine13\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28\"},\"headline\":\"Testing Complex Logic with JMeter Beanshell\",\"datePublished\":\"2018-06-18T12:57:01+00:00\",\"dateModified\":\"2018-06-18T12:57:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/\"},\"wordCount\":833,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"articleSection\":[\"Blog\",\"JMeter\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/\",\"name\":\"Testing Complex Logic with JMeter Beanshell - RedLine13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2018-06-18T12:57:01+00:00\",\"dateModified\":\"2018-06-18T12:57:01+00:00\",\"description\":\"This post will show the different Beanshell capabilities and use cases for testing complex logic and how RedLine13 can enhance the load testing.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Testing Complex Logic with JMeter Beanshell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28\",\"name\":\"RedLine13\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g\",\"caption\":\"RedLine13\"},\"sameAs\":[\"http:\/\/127.0.0.1\"],\"url\":\"https:\/\/www.redline13.com\/blog\/author\/user\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Testing Complex Logic with JMeter Beanshell - RedLine13","description":"This post will show the different Beanshell capabilities and use cases for testing complex logic and how RedLine13 can enhance the load testing.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/","og_locale":"en_US","og_type":"article","og_title":"Testing Complex Logic with JMeter Beanshell - RedLine13","og_description":"This post will show the different Beanshell capabilities and use cases for testing complex logic and how RedLine13 can enhance the load testing.","og_url":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/","og_site_name":"RedLine13","article_published_time":"2018-06-18T12:57:01+00:00","og_image":[{"width":1000,"height":611,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2017\/02\/apache-jmeter-redline13-load-testing.png","type":"image\/png"}],"author":"RedLine13","twitter_card":"summary_large_image","twitter_misc":{"Written by":"RedLine13","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/"},"author":{"name":"RedLine13","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28"},"headline":"Testing Complex Logic with JMeter Beanshell","datePublished":"2018-06-18T12:57:01+00:00","dateModified":"2018-06-18T12:57:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/"},"wordCount":833,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"articleSection":["Blog","JMeter"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/","url":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/","name":"Testing Complex Logic with JMeter Beanshell - RedLine13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2018-06-18T12:57:01+00:00","dateModified":"2018-06-18T12:57:01+00:00","description":"This post will show the different Beanshell capabilities and use cases for testing complex logic and how RedLine13 can enhance the load testing.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2018\/06\/testing-complex-logic-with-jmeter-beanshell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Testing Complex Logic with JMeter Beanshell"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28","name":"RedLine13","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g","caption":"RedLine13"},"sameAs":["http:\/\/127.0.0.1"],"url":"https:\/\/www.redline13.com\/blog\/author\/user\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/4878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=4878"}],"version-history":[{"count":0,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/4878\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/4171"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=4878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=4878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=4878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}