JEval - Evaluate your JMeter Test Plan
Tags: productivity, testing, webperf, tools
Published: 2020-10-19 15:39:34

This blog post originally appeared on my [blog](https://qainsights.com/jeval-evaluate-your-jmeter-test-plan/).

<!-- wp:paragraph -->
<p><strong>JEval - Evaluate your JMeter Test Plan </strong>Few weeks ago I had released <strong>JEval</strong> - a small Python based utility which evaluates JMeter test plan and provide you the recommendations and best practices by analyzing each element. In this blog post, I will explain how JEval will be useful, how it works, its limitations and more.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>What is JEval?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>JMeter Evaluator, shortly JEval helps to evaluate your JMeter test plan and gives you set of recommendations in a color coded format.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Why JEval?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>As a performance engineer, we create and maintain scripts almost on daily basis. Because changes are inevitable. If you are working in JMeter, then you disable and enable elements, you keep adding elements which you forget eventually to disable after debugging the script.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>JEval helps to evaluate the test plan and provides you an analysis of each element whether you want to enable or disable them. This will help in optimizing your test plan for better resource utilization.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<iframe src="https://www.linkedin.com/embed/feed/update/urn:li:share:6713632433037733888" allowfullscreen="" title="Embedded post" width="504" height="521" frameborder="0"></iframe>
<!-- /wp:html -->

<!-- wp:heading -->
<h2>Use case #1</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Assume that there is a new release on JMeter, but you are still using the older version. JEval  reveal that you are using the older version and highlight you to update to the latest version.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Use case #2</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You have enabled umpteen Listeners in your test plan which is not required when the test is running in the CLI mode. JEval catches that and provides a recommendation to disable it.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Use case #3</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Please share how JEval helps in your project. I will list them here.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>How it works?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>JMeter test plan is an XML document. Python script parses through each element and compares it with the set of rules and displays the relevant output.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The whole project is open source, you can check the complete code in GitHub. </p>
<!-- /wp:paragraph -->

<!-- wp:generateblocks/button-container {"uniqueId":"a16a88dd","alignment":"center"} -->
<div class="gb-button-wrapper gb-button-wrapper-a16a88dd"><!-- wp:generateblocks/button {"uniqueId":"df0f6016","target":true,"backgroundColor":"#0366d6","textColor":"#ffffff","backgroundColorHover":"#222222","textColorHover":"#ffffff","paddingTop":"15","paddingRight":"20","paddingBottom":"15","paddingLeft":"20"} -->
<a class="gb-button gb-button-df0f6016" href="https://github.com/QAInsights/JEval" target="_blank" rel="noopener noreferrer"><span class="button-text">JEval GitHub Repo</span></a>
<!-- /wp:generateblocks/button --></div>
<!-- /wp:generateblocks/button-container -->

<!-- wp:heading -->
<h2>Important Notes</h2>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li><em>JEval doesn't make any modifications to your JMeter test plan. But it is advisable to make a backup of your JMeter test plan.</em></li></ul>
<!-- /wp:list -->

<!-- wp:list -->
<ul><li><em>JEval utility doesn't collect any sort of data</em></li></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2>Sample Output of JEval</h2>
<!-- /wp:heading -->

<!-- wp:image {"align":"center","sizeSlug":"large"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><img src="https://raw.githubusercontent.com/QAInsights/JEval/master/assets/JEval-Output.jpg" alt="JEval - Evaluate your JMeter Test Plan"/><figcaption>JEval - Evaluate your JMeter Test Plan - Sample Output</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Features of JEval</h2>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>JMeter version detection</li><li>Test plan validity</li><li>Detects the relevant elements</li><li>Detects JMeter Plugins</li><li>Customizable via <code>config.yaml</code> file</li><li>Custom elements can be added in the <code>config.yaml</code> file</li><li>Measures time taken for each analysis</li><li>Generates log file</li><li>Integrates with your CI/CD as it is command line program</li></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2>Limitations</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>No tool is perfect. JEval comes with its own limitations.</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>If the test plan has Loop element which has a lot of elements as its child, then JMeter will not detect them.</li></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2>How to use JEval?</h2>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>Clone the <a href="https://github.com/QAInsights/JEval" target="_blank" rel="noreferrer noopener">repository</a>.</li><li>Install the latest version of Python</li><li>Install the dependencies<br><code>pip install -r requirements.txt</code></li></ul>
<!-- /wp:list -->

<!-- wp:list -->
<ul><li>cd into the repository</li><li>Issue the below command<br><code>python app.py -f &lt;JMeter-File-Path&gt;</code><br>E.g.<br><code>python app.py -f .\jmx\Sample.jmx</code></li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Thanks to <a href="https://goo.gl/rTd92i"><strong>Anthony Gauthier</strong></a> and <a href="http://bit.ly/33oAQDj"><strong>Leela Prasad</strong></a> for their excellent contributions for JEval.</p>
<!-- /wp:paragraph -->