Testing Tour Stop #3 : Pairing Performance and Load Testing using Jmeter with Mirjana

My third stop was with Mirjana Andovska. We haven't met or know each other before this session, I was really excited for this session. She saw my tweet about my #TestingTour  so she approached me which I was so glad about. I was super happy that someone reached me to join my tour.
 I still don't have a tool set up to book my time slot so she had to approach me on twitter to book this session. If anyone would like to pair with me on this tour please DM me πŸ™


We started off our session by sharing our experiences of solo testers, it was so interesting to see how we share the similar experiences of being a solo tester. We got connected by this topic as we had similar experiences, of having no one to share or learn from. Mirjana also mentioned that she was part of couple of Lisi's pairing sessions related to her Testing Tour and #CodeConfident.

After having a brief introduction, now comes the first question. What shall we do and pair on? Out of few topics, we decided to pair on performance and load testing using JMeter which was a good topic to choose as I was having some challenges and I was a complete newbie on this. I started to share what I have done so far so that we both understand the initial context of the tests and the application. 

Bit of Context 

I have been using JMeter since last 3 weeks, I had to write some tests so we can start our first steps into performance and load testing. As I was new to this I had no preference of choice of a tool so I picked up JMeter and started to write some tests by picking up the most important or used user journeys which I got from the analytics and logs of the system related to different users. I was writing tests for a multi-tenancy application. The term "software multitenancy" refers to a software architecture in which a single instance of the software runs on a server and serves multiple tenants.

Next step, we started to explore the tests which I had written and  Mirjana shared that Jmeter has great documentation and a great community. The first thing she noticed from my tests was that I have some common variables which were repeated in every test. She gave me a suggestion, for me it was a great tip number 1, to add 'Http Request Defaults'.

Instead of repeating the common variables such as protocol, server name and port number which was same for every test or Http request I had written I can add HTTP Defaults. I got excited to know that there is such an option, and then I shared the reason why I was excited. Just yesterday I spent the whole day to write the same tests for all different clients, I had to change the server name manually for every single test for every single client which reminded me of doing a manual regression testing where you feel it as a boring task because you are not writing any new tests but just changing the server name repeatedly. If I knew this option of adding 'Http Defaults' lot of my time would have been saved. Even Mirjana was happy to see me get excited that I got this tip which I can use it while implementing these tests for remaining clients. 

Mirjana asked me why am I writing the same tests for each client when they are accessing the same API's.  I explained that I had to repeat the same test for different clients as the test data is different for each of them and also I wanted to check the load of these API's when different users from different clients hit these endpoints at the same time. Again I did this based on my understanding towards this tool and performance or load testing which I might update or improve. But she got my point and explained it further that it makes sense to write the tests for different clients using parameters, because these tests are having similar requests and she compared it to 'modelling' the script.

When she heard about test data, she gave me tip number 2 to use "CSV Data Set Config". I thought it's really helpful to know this as I can add the test data related to different clients using this feature which could also be easier for me to maintain and update from one location instead of going to each test to update.

Then she explained to me about the ramp up time by a drawing which was very interesting. She used 'Paint' app to draw and explain all about ramp up time. And then we decided to actually start writing some tests by being a navigator and driver and Mirjana decided to drive first. We wanted to make changes by adding 'Http Defaults', so Mirjana added a protocol, server and port number into that new header request. Initially, we were not very confident to add this header on the existing test as we had fear of breaking some existing test. It was the same fear when the developer says its a small code change and we as testers have the fear that it might break something. We isolated this test by disabling all other tests and tried running this single test. It failed on the first run, then we realised it was a typo error when we executed again it was successful. 

Next, I took the control and added this 'Header Defaults' request to my existing test instead of isolating it. I was going into each test to delete the protocol, server name and port number as I have added it into 'Header Defaults'. That's where Mirjana gave me tip number 3 where she shared that instead of going into each test and removing the repeated variables from GUI we can remove by either using the jmx file in notepad, notepad++ or IntelliJ IDE. We went to the location of the test file and opened in notepad++ and we decided to remove the common variables from just one test, save and check-in JMeter GUI to make sure the changes were effected. And to see if the changes were effected in JMeter we had close and reopen the file. We could see the test was updated and the common variables were removed from the test.

Now Mirjana took control and deleted all the common variables from all the tests by first using the 'Find' feature in notepad++ and then replacing them all with "> <". It becomes so simple and easy when we know these kinds of short tricks or shortcuts. By doing this we were refactoring our code and testing it to make sure it doesn't break. It was really fun doing this and great joy as well. 

. Then Mirjana explained to me about making our tests/scripts readable by using the groups. She also explained to me about running these tests from CLI but could not have enough time to do this. 
It was a great combination of exploring, modifying and writing new tests together. There was a great sense of collaboration and communication and we were very energetic throughout the session. We ended this session with so much happiness and smiles on our faces. 

  • I got to learn various tips like adding test data, modifying tests using notepad++ or any IDE using find and replace, use of simple config elements like Header Defaults to eliminate duplication of variables.
  • Running these tests by using different threads and ramp-up time we are doing exploration and observation of application when it's under stress. 
  • Whenever we see that we are repeating the actions we should try and find out some short tricks just like how developers try to find ways using their coding abilities to find the solution. 
  • Importance of running the tests from CLI instead of JMeter GUI.
  • When two passionate people pair together there is never enough time :D
  • Make use of different features of JMeter to make the tests more organised and readable so that anyone from the team can pick up those test and understand very easily. 
We ended up having 2 hrs session instead of 1 hour planned session which was amazing. Even though we have never met or know each other we both learned and shared and most importantly we both felt the same energy. Now next step for me is to apply all these new learnings and tips while writing my tests for performance and load using JMeter.

Please reach me out if you are interested to pair with me :D

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.