Software performance testing services are in great demand by many of our clients, so I’ve recently been tasked with learning JMeter. JMeter is an open source tool, and like many open source tools, there are many resources available for those like me who are trying to learn. I thought I’d share tips on getting started with JMeter as well as some great resources for learning.
It took me just five minutes to get JMeter installed and working on my brand new PC without any problem. It’s impressive that JMeter doesn’t require any complicated installation and configuration steps at all (unlike Appium, which took hours just for the install preparation). After installing JMeter, I opened one of the scripts from our existing script library. I was surprised by the length and complexity as it seemed that every controller had endless sub-controllers and sub-requests. And, if you unfold each of the requests, there are even more elements under them. On top of that, each has a configuration page that takes up the entire screen. I was a little frightened and thought that it might take years for me to write such scripts.
But, soon I found that there were no more than 10 types of icons in the script and the elements with the same icon work the same way, no matter how many or how deep they are. I also discovered that some requests and functions just repeat themselves, or show up under a certain condition. I took a guess that the complexity was not about the tool but about the scenarios and workflows that simulate how the user uses the product, and it could be generated and imported by recording. Then I went to my favorite website, guru99.com, where I first learned Selenium, Appium and many others. (I like the way they teach things as they always use language that is easy to understand with plenty of diagrams to help explain things. Most importantly, the examples they provide always work.) After half a day of reading, I became familiar with how JMeter works and was able to read and write some simple scripts. Whenever I had questions, I was able to find the answer from the Internet in seconds as JMeter is very popular. I also researched and viewed videos that provided more details for hands-on testing and troubleshooting. Udemy was the best one because it systematically shows you how to use JMeter with a structure that makes a lot of sense. The coverage of concepts went from basics all the way to the very advanced points. The only drawback was the accent of the narrator – I sometimes had to guess what was being said.
Two days later, I found that I could understand every single step in the script that I opened the first time, and I was able to write the same types of scripts if the scenarios were clearly specified. The only thing that requires a lot of time is developing a deep understanding of the workflow of the product and figuring out a suitable strategy for how the security is being implemented for things like sessions and cookies. This is important because you have to spend a lot of time on parameterization to make the script flexible and reusable. I found that learning JMeter is actually pretty fun. There’s a sense of accomplishment in moving forward with such progress.
As I continued my learning, I realized that the tool itself is not difficult at all. The real difficulties are the strategies on how to define the transactions and workflows of the product, design the load test cases, determine different combinations of the transactions, simulate the distribution of the load, and make sure that the testing is meaningful and pragmatic. I felt it was like becoming a composer rather than a pianist, or an architect instead of a construction worker. Much more thinking involved than just picking up a shovel.
Based on my recent experience, it takes only one week for a person with IT background, and possibly two weeks, for someone with limited or no background, to learn the basics of JMeter. The problem is not in writing scripts themselves, but in designing the whole, where the whole includes many of the issues I’ve listed above, plus being able to generate meaningful and actionable reports. Writing and executing scripts with JMeter is just the beginning. The hard part is not just from the tool perspective but tying the tool to performance testing design, strategy, statistics, analytical methods, and the like.