JMeter, Performance Testing, Testing, Web Service Testing

Unboxing Apache JMeter 4.0

Unboxing Apache JMeter 4.0 Hello QAInsights Readers! Apache released its newer of JMeter named JMeter 4.0 which support Java 9. In this article, we shall see what’s new in Apache JMeter 4.0, how you can download JMeter 4.0 and start using it in your projects.

How to download Apache JMeter 4.0?

Head over to https://jmeter.apache.org/download_jmeter.cgi and click on apache-jmeter-4.0.zip to start downloading the zip file. File size is 49.1 MB after extraction 88.4 MB

Unboxing Apache JMeter 4.0
Unboxing Apache JMeter 4.0

You can see the release notes over here https://jmeter.apache.org/changes.html

How to launch JMeter 4.0 in Windows?

After extracting the zip file, go to \apache-jmeter-4.0\apache-jmeter-4.0\bin and double click on jmeter.bat. Very first time, it may throw the security warning, click on More Info and hit Run anyway in Windows 10 machine. Below is the snapshot of JMeter IDE and About Apache JMeter dialog.

Darcula Theme
Darcula Theme

UI changes

The major UI change in JMeter 4.0 is the new theme called Darcula. You can read more about Darcula theme in here.

Darcula Theme
Darcula Theme

Personally I like this theme, but if you would like to work in light theme, you can change it. But right now, it will throw below message.

Darcula Theme message
Darcula Theme message

Frequently accessed items are now grouped together and separated by a line as shown below. This will improve your productivity negligibly.

Most Used Elements
Most Used Elements

Most useful change in the UI is the transaction names in the Test Script Recorder. You can configure the Prefix or you can enter your Transaction Name while recording.

Prefixing your requests
Prefixing your requests
Transaction Name
Transaction Name

Auto saving feature now helps you to save your test plan before you trigger it. This will save ample time in case of unexpected crash and failures.

Function Helper now has Generate and Copy to clipboard.

Function Helper
Function Helper

Setting up the JMeter Environment

If you want to run a few tasks before you launch JMeter, you can set it up using setenv.bat in bin folder. E.g. below code will ask the user to enter yes or no. Copy below code and create setenv.bat in bin folder and launch JMeter by double clicking on jmeter.bat.

ECHO http://www.QAInsights.com

set /p input= enter yes or no

if %input%==yes echo you typed yes

if %input%==no echo you typed no

pause

echo this is how setenv dot bat works in jmeter four dot O

pause

Above code will be executed before it launches the JMeter. You can use setenv.bat in below situations:

  1. To run test data setup tasks
  2. To restart your environment
  3. To smoke test the applications and/or APIs
  4. To backup the JMeter scripts
  5. To play a small game 🙂
setenv bat file
setenv bat file

New functions in Apache JMeter 4.0

Following functions are introduced in this newer version:

  • __digest
  • __dateTimeConvert
  • __changeCase
  •  __isVarDefined
  • __isPropDefined
__digest
__digest
__changeCase
__changeCase

Main features

Boundary Extractor helps you to extract the dynamic/static content from the response. It works like Regular Expression Extractor, but in Boundary Extractor, you need to provide the regular expression. This works for HTTP, Mail Reader and samples generated by transaction controller.

Boundary Extractor
Boundary Extractor

New timer is in town, called Precise Throughput Timer to simulate Poisson arrivals.

Precise Throughput Timer
Precise Throughput Timer

Now you can read, browse and clear in JMS Point-to-Point sampler. Also new JSON assertion helps you to check the JSON responses. New If controller warns user to check Interpret Condition as Variable Expression for better performance.

If controller
If controller

Response Assertion allows users to assert the Request Data.

Response Assertion
Response Assertion

As usual, in this newer version lots of bug fixes, enhancements have been done. Please download JMeter 4.0 and try again, if you face any issues, please let me know in the comments. Also, make sure that you are taking backups before you upgrade your scripts and execution.

Once a week we send a digest with the most popular articles.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

My new eBook - "Earn Cash by Performance Testing" is now available w/ 70% OFFBuy Now
+ +