5 Key Things You Need to Know About JMeter 3.0
Find out what is new in this first major release from JMeter in over 12 years.
Join the DZone community and get the full member experience.Join For Free
the apache jmeter team has just released jmeter 3.0, a major new release of the leading open source testing tool. it is loaded (no pun intended) with several new features and improvements.
jmeter’s first news major release in more than a decade
this is the first major release from jmeter in over 12 years , as jmeter 2.0 was released in april 2004 . rather than jmeter releasing version 2.14, it has jumped to 3.0. what does this mean?
a major release is not merely a revision of the previous version nor simply a series of bug fixes, but rather contains substantial changes such as several new features, a source code rewrite, core improvements, and changes related to compatibility ui changes. long story short - it’s not just maintaining previous versions, but creating something quite different and new. so the release of jmeter 3.0 is big news.
(for those looking tor how to migrate to and install jmeter 3.0, see detailed instructions at the end of this post.)
meet jmeter 3.0
here are five of the most important things you need to know about jmeter 3.0.
1. new ux and ui
the first thing what you will notice when you launch the app is the new apache logo and that jmeter’s logo was changed as well. you will also see some new icons and elements on the user interface. on the right side of the toolbar you can see a new element that shows the elapsed time of a current test and new icons for existing elements.
the icons in the test plan tree were also changed, now looking more polished and attractive in my opinion.
here is the screenshot of the test plan tree with the various elements added.
in addition to these changes, jmeter 3.0 includes various ui/ux improvements such as:
below is a view of the advanced tab in “http request” and in “http request defaults”:
2. scripting and debugging enhancements
scripting and debugging jmx files with jmeter 3.0 becomes easier with these new features and enhancements:
- shortcuts to insert elements - this allows for faster scripting for professional jmeter users. contributed by blazemeter, these shortcuts - ctrl+0 , ctrl+1 , ctrl+2…ctrl+9 - enable you to quickly add elements into the test plan. it binds the ctrl+ # keys to certain elements in jmeter and with one key press, you get that element
- new validation feature - in one click, you can now run a selection of thread groups with 1 user, no pause, and 1 iteration. this helps you to debug and build your scripts
- new search feature in the view results tree - this allows you to search for text / regexp in request/responses/headers/cookies/ - it really helps to debug scripts with the dynamic values correlation
- the migration to httpclient 4.5.2 improves the following fields of jmeter:
- the most important change here is improved cookie handling which helps to overcome several issues in previous jmeter versions
- server name indication (sni) support
- better keep-alive and stale connections handling (less nohttpresponseexception)
- better support for compressed responses. this is actually a revolutionary change. while there might be some unexpected changes in behavior, it is much better and more modern than previous versions
- additionally, the library upgrade has a really nice impact on jmeter plugins . previously, there was a library conflict with selenium webdriver testing, while jmeter 3.0 resolves that conflict
- improved embedded resources download (background, images, etc.) - more resources are detected, there are faster parallel downloads
3. json responses handling
today, most websites use the json format in their ajax calls, so you can’t avoid using json components in your scripts, and we recently published a blog post on how to handle json responses in jmeter using third-party jmeter plugins.
jmeter 3.0 brings the solution for json handling into core functionality, introducing the jsonpath post processor component. it works quite similarly to the one from the jmeter plugins, using the same jsonpath syntax used for the expressions. be sure to read more in our post, advanced usage of the json path extractor in jmeter .
4. improvements in reporting
as you know, a major issue in the jmeter 2.x versions was reporting load test results. you had to always generate raw data in csv or xml formats and upload them to analyze the results. while many other load testing tools offered nice looking html reports with charts, these were missing in jmeter. for example tsung and gatling has a built-in html report generator, but jmeter didn’t support html reporting by default, that is until now.
for the 3.0 version, jmeter offers various reporting enhancements such as:
- generating dynamic graphs in html pages (apdex, summary report, and graphs)
- summariser displays a more readable duration
- backendlistener supports regular expressions for sampler list
let’s examine the generating report dashboard, which can be done at the end of testing or anytime from the results file. the report dashboard includes an apdex (application performance index) table, a request summary graph, a statistics table, an error table and various zoomable charts. see below.
if you have ever used the backendlistener, defining samplers was a bit tricky and i have to say that i personally was waiting for current change released in jmeter 3.0 for a long time. while in the jmeter 2.13 samplerlist you had to define all samplers individually, now it’s possible to use the regexp pattern to include samplers in the list. i also have to say that the summarizer's readable duration will be helpful while running jmeter in non-gui mode as well.
more of the changes
jmeter 3.0 is really one of the biggest releases, which comes to change load/performance testing drastically. hopefully, after reading this article you will be able to use all the new features, and decrease the time and budget needed for load testing.
as said before, the new version is not just a bugfix release, but rather touches almost all aspects of load testing. for example, the groovy scripting language library for jsr223 components is now bundled into jmeter package, which is a great convenience for heavy jmeter users.
if you are looking for further information about the features and upgrades in jmeter 3.0, you can view the full changes log here .
5. migrating to jmeter 3.0
before starting the migration to jmeter 3.0, we recommend checking your existing java version, as the new jmeter version can be run only with java 7 or above.
there are two easy ways to check your java version:
- verifying online - to verify online, open http://www.java.com/en/download/installed.jsp and click the “verify java version” red button. if java is enabled in your browser settings, you will see a dialog window which asks permission to run the java applet . press the “run” button and you will see the version of your java installed in your system.
- open your “console/command prompt” and run this command: “java -version”. from the first line of the command output, you can see the java version and it will look something like java version "1.7.0_95", where the second number shows the java version. so if it’s equal or above 7, you can proceed with the next steps.
in case your current version installed is java 6 or below, you should open the java official page and follow the installation instructions.
hopefully, now that you have the compatible java version, move forward and create a dump of the existing jmeter version. we do not recommend extracting and replacing the new jmeter lib files into the existing jmeter folder because it will cause incompatibility issues. it’s easier and better to keep them separated. once you have a backup of the existing jmeter, proceed with downloading the new jmeter version.
to download jmeter 3.0, open http://jmeter.apache.org/download_jmeter.cgi and choose apache-jmeter-3.0.zip or apache-jmeter-3.0.tgz archives, which include the compiled jmeter binaries. once it’s downloaded, extract it to separate folder and execute.
there are still a few more steps left if you have distributed jmeter instances. we recommend you to test your jmx files and all external plugins before deploying jmeter 3.0 into remote servers because some of the plugins might not be compatible with the new version.
finally, the last step is to enjoy jmeter 3.0!
want to learn more about jmeter?
if you are new to jmeter, and you’d like to learn more, please sign up for our free online jmeter training course .
for more experienced jmeter users, you'll want to view the on-demand webcast, how to create advanced load testing scenarios with jmeter .
Published at DZone with permission of Jason Silberman. See the original article here.
Opinions expressed by DZone contributors are their own.