DEV Community

Cover image for JMeter, acquaintance and installation

JMeter, acquaintance and installation

afsharm profile image Afshar Mohebi ・2 min read

I am intending to challenge a new project which includes a series of concurrent issues. Debugging the problem is hard as result of it not being reproduced easily. In other words, the back-end guy does not know how this happens. Hence, as a solution, I am thinking of a simulation scenario. To be more clear, I want to simulate a lot of simultaneous mobile applications which call the APIs. Hopefully, this can help the back-end party how the defect is created. Additionally, this scenario will help a lot in testing and quality assurance once the issue is declared as resolved.

After all, I decided to find out a way to test the APIs. Obviously no unit test could help here. Because, the procedure was working fine when only one user was using the system. Postman API testing was not helpful in a similar way, so the integration test was not helpful either. Finally, it was the integration test which came to my mind as the solution. This kind of test could reveal the system behavior in a real usage scenario.

So, after deciding on what sort of testing will help the situation, I started my search of integration test solutions. Though, it was not a difficult task, as I just wanted open-source/free solutions which could be run on-premises. Consequently, I chose JMeter as it is open source, it is free and it runs on-premises. Moreover, its statistics on SQA and SO is much higher than its competitors.

My actual trail of JMeter started by installing it on my Windows 10 machine. First thing first, I installed Java Run Time. I bumped into wall in my first try as the Java I installed was too old for JMeter. After installing version 10.0.2 of Java the problem solved. Next, I moved Jmeter folder to my Program Files (x86) folder, and put the bin directory path in the system's Path variable. But, this time I get error:

\apache-jmeter-5.1.1\bin\ was unexpected at this time.

Adding lib, lib\ext and extras directory paths to the Path variable did not helped either. I also granted full access control to the current user and opened command prompt as administrator which was did not come to help either. Even a system restart did not help the situation.

Beginning from here, I began to suspect of the bat file responsible to run JMeter. I dig into for/do batch statements, and suddenly found a link which was talking about a space in the Program Files (x86) folder name. Yes! It is the root cause. The jmeter.bat could not handle the space in the Program Files (x86) directory name correctly. I just preferred not to correct it, and instead, moved the entire apache-jmeter-5.1.1 directory to the root of C: drive. After updating the Path variable, the problem solved, and JMeter was able to run in the command prompt in any path I wanted.

My next step in this journey will be an exploration on JMeter, and what features it has for me.

Discussion (0)

Editor guide